diff --git a/.travis.yml b/.travis.yml index bd077c4b08..a03018c404 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,11 @@ cache: - "~/.platformio" env: - - TEST_PLATFORM="-e megaatmega2560" + - TEST_PLATFORM="megaatmega2560" + - TEST_PLATFORM="LPC1768" + - TEST_PLATFORM="DUE" + - TEST_PLATFORM="STM32F1" + - TEST_PLATFORM="teensy35" before_install: # @@ -26,6 +30,8 @@ before_install: # Publish the buildroot script folder - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/bin/* - export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${PATH} + - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/share/tests/* + - export PATH=${TRAVIS_BUILD_DIR}/buildroot/share/tests/:${PATH} install: #- pip install -U platformio @@ -56,3 +62,4 @@ branches: - # Do not build tags that we create when we upload to GitHub Releases - /^(?i:continuous)$/ + diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 3137bb961f..2ff7e519eb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -281,6 +281,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -312,7 +313,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 20 #define TEMP_SENSOR_1 0 @@ -563,6 +564,29 @@ #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. #define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -711,6 +735,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -813,6 +838,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1387,11 +1413,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1871,7 +1896,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 39790caf4b..17254eeb0b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ #define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ #define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1674,9 +1641,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1713,4 +1682,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/HAL/HAL_AVR/HAL.h b/Marlin/src/HAL/HAL_AVR/HAL.h index 9093910c24..02aafc0fbd 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL.h +++ b/Marlin/src/HAL/HAL_AVR/HAL.h @@ -345,7 +345,8 @@ inline void HAL_adc_init(void) { #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin) #endif -#define HAL_READ_ADC ADC +#define HAL_READ_ADC() ADC +#define HAL_ADC_READY() !TEST(ADCSRA, ADSC) #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin @@ -353,4 +354,7 @@ inline void HAL_adc_init(void) { #define HAL_SENSITIVE_PINS 0, 1 +// AVR compatibility +#define strtof strtod + #endif // _HAL_AVR_H_ diff --git a/Marlin/src/HAL/HAL_AVR/SanityCheck.h b/Marlin/src/HAL/HAL_AVR/SanityCheck.h index f2907205d7..254da910c1 100644 --- a/Marlin/src/HAL/HAL_AVR/SanityCheck.h +++ b/Marlin/src/HAL/HAL_AVR/SanityCheck.h @@ -99,7 +99,7 @@ /** * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) */ -#if ENABLED(HAVE_TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \ +#if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \ defined(X_HARDWARE_SERIAL ) \ || defined(X2_HARDWARE_SERIAL) \ || defined(Y_HARDWARE_SERIAL ) \ diff --git a/Marlin/src/HAL/HAL_AVR/fastio_1280.h b/Marlin/src/HAL/HAL_AVR/fastio_1280.h index 31c5b5edc6..1c65f2bde7 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_1280.h +++ b/Marlin/src/HAL/HAL_AVR/fastio_1280.h @@ -23,8 +23,9 @@ /** * Pin mapping for the 1280 and 2560 * - * Logical Pin: 22 23 24 25 26 27 28 29 53 52 51 50 10 11 12 13 37 36 35 34 33 32 31 30 21 20 19 18 81 82 83 38 00 01 78 05 02 03 79 80 54 55 56 57 58 59 60 61 41 40 39 71 70 04 17 16 84 06 07 08 09 85 15 14 72 73 75 76 77 74 62 63 64 65 66 67 68 69 49 48 47 46 45 44 43 42 - * Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5 H0 H1 H2 H3 H4 H5 H6 H7 J0 J1 J2 J3 J4 J5 J6 J7 K0 K1 K2 K3 K4 K5 K6 K7 L0 L1 L2 L3 L4 L5 L6 L7 + * Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100 + * Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx + * Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx */ #ifndef _FASTIO_1280_H_ diff --git a/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp index 9d5ddd1bd7..ef6fbeabd5 100644 --- a/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp @@ -9,13 +9,8 @@ namespace HAL { namespace PersistentStore { -bool access_start() { - return true; -} - -bool access_finish(){ - return true; -} +bool access_start() { return true; } +bool access_finish() { return true; } bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { while (size--) { diff --git a/Marlin/src/HAL/HAL_DUE/HAL.h b/Marlin/src/HAL/HAL_DUE/HAL.h index 805acd28d6..c0f8141e5b 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL.h +++ b/Marlin/src/HAL/HAL_DUE/HAL.h @@ -141,7 +141,8 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); inline void HAL_adc_init(void) {}//todo #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC HAL_adc_result +#define HAL_READ_ADC() HAL_adc_result +#define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); uint16_t HAL_adc_get_result(void); diff --git a/Marlin/src/HAL/HAL_DUE/SanityCheck.h b/Marlin/src/HAL/HAL_DUE/SanityCheck.h index 16e07bd3b4..f24233a859 100644 --- a/Marlin/src/HAL/HAL_DUE/SanityCheck.h +++ b/Marlin/src/HAL/HAL_DUE/SanityCheck.h @@ -41,7 +41,7 @@ */ #define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN)) -#if ENABLED(SDSUPPORT) && ENABLED(HAVE_TMC2130) +#if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130) #if ENABLED(TMC_USE_SW_SPI) #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK)) #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs." diff --git a/Marlin/src/HAL/HAL_DUE/fastio_Due.h b/Marlin/src/HAL/HAL_DUE/fastio_Due.h index fe0923ead5..bb25f45174 100644 --- a/Marlin/src/HAL/HAL_DUE/fastio_Due.h +++ b/Marlin/src/HAL/HAL_DUE/fastio_Due.h @@ -39,6 +39,8 @@ #ifndef _FASTIO_DUE_H #define _FASTIO_DUE_H +#include + /** * Utility functions */ @@ -64,8 +66,8 @@ // Write to a pin #define _WRITE_VAR(IO,V) do { \ - volatile Pio* port = g_APinDescription[IO].pPort; \ - uint32_t mask = g_APinDescription[IO].ulPin; \ + volatile Pio* port = digitalPinToPort(IO); \ + uint32_t mask = digitalPinToBitMask(IO); \ if (V) port->PIO_SODR = mask; \ else port->PIO_CODR = mask; \ } while(0) @@ -78,56 +80,48 @@ else port->PIO_CODR = mask; \ } while(0) -// toggle a pin +// Toggle a pin #define _TOGGLE(IO) _WRITE(IO, !READ(IO)) -// set pin as input +// Set pin as input #define _SET_INPUT(IO) do{ \ pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \ - PIO_Configure(g_APinDescription[IO].pPort, PIO_INPUT, g_APinDescription[IO].ulPin, 0); \ + PIO_Configure(digitalPinToPort(IO), PIO_INPUT, digitalPinToBitMask(IO), 0); \ }while(0) -// set pin as output +// Set pin as output #define _SET_OUTPUT(IO) do{ \ pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \ - PIO_Configure(g_APinDescription[IO].pPort, _READ(IO) ? PIO_OUTPUT_1 : PIO_OUTPUT_0, g_APinDescription[IO].ulPin, g_APinDescription[IO].ulPinConfiguration); \ + PIO_Configure(digitalPinToPort(IO), _READ(IO) ? PIO_OUTPUT_1 : PIO_OUTPUT_0, digitalPinToBitMask(IO), g_APinDescription[IO].ulPinConfiguration); \ g_pinStatus[IO] = (g_pinStatus[IO] & 0xF0) | PIN_STATUS_DIGITAL_OUTPUT;\ }while(0) -// set pin as input with pullup mode +// Set pin as input with pullup mode #define _PULLUP(IO,V) pinMode(IO, (V) ? INPUT_PULLUP : INPUT) -// check if pin is an input -#define _GET_INPUT(IO) -// check if pin is an output -#define _GET_OUTPUT(IO) - -// check if pin is a timer -#define _GET_TIMER(IO) - -// Read a pin wrapper +// Read a pin (wrapper) #define READ(IO) _READ(IO) -// Write to a pin wrapper +// Write to a pin (wrapper) #define WRITE_VAR(IO,V) _WRITE_VAR(IO,V) #define WRITE(IO,V) _WRITE(IO,V) -// toggle a pin wrapper +// Toggle a pin (wrapper) #define TOGGLE(IO) _TOGGLE(IO) -// set pin as input wrapper +// Set pin as input (wrapper) #define SET_INPUT(IO) _SET_INPUT(IO) -// set pin as input with pullup wrapper +// Set pin as input with pullup (wrapper) #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) -// set pin as output wrapper - reads the pin and sets the output to that value +// Set pin as output (wrapper) - reads the pin and sets the output to that value #define SET_OUTPUT(IO) _SET_OUTPUT(IO) -// check if pin is an input wrapper -#define GET_INPUT(IO) _GET_INPUT(IO) -// check if pin is an output wrapper -#define GET_OUTPUT(IO) _GET_OUTPUT(IO) -// check if pin is a timer (wrapper) -#define GET_TIMER(IO) _GET_TIMER(IO) +// Check if pin is an input +#define GET_INPUT(IO) !(digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) +// Check if pin is an output +#define GET_OUTPUT(IO) !!(digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) +// Check if pin is a timer - Must be a constexpr +#define GET_TIMER(IO) ((IO) >= 2 && (IO) <= 13) // Shorthand #define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); } diff --git a/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp index f5276e045c..aef1d79f48 100644 --- a/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp @@ -11,14 +11,12 @@ extern void eeprom_flush(void); namespace HAL { namespace PersistentStore { -bool access_start() { - return true; -} +bool access_start() { return true; } -bool access_finish(){ -#if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM) - eeprom_flush(); -#endif +bool access_finish() { + #if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM) + eeprom_flush(); + #endif return true; } diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.h b/Marlin/src/HAL/HAL_ESP32/HAL.h index c3a3f00955..28e75b332e 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.h +++ b/Marlin/src/HAL/HAL_ESP32/HAL.h @@ -109,7 +109,8 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); void HAL_adc_init(void); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC HAL_adc_result +#define HAL_READ_ADC() HAL_adc_result +#define HAL_ADC_READY() true void HAL_adc_start_conversion (uint8_t adc_pin); diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.h b/Marlin/src/HAL/HAL_LPC1768/HAL.h index d11c552e2b..b26581d443 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.h @@ -68,9 +68,15 @@ extern "C" volatile uint32_t _millis; #include "HAL_timers.h" #include "HardwareSerial.h" -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(600) +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(750) +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(750) +#endif extern HalSerial usb_serial; @@ -140,11 +146,13 @@ uint8_t spiRec(uint32_t chan); // ADC #define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin) #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC HAL_adc_get_result() +#define HAL_READ_ADC() HAL_adc_get_result() +#define HAL_ADC_READY() HAL_adc_finished() void HAL_adc_init(void); void HAL_adc_enable_channel(int pin); void HAL_adc_start_conversion(const uint8_t adc_pin); uint16_t HAL_adc_get_result(void); +bool HAL_adc_finished(void); #endif // _HAL_LPC1768_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp index 74543ee7d2..c8fe029d39 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp @@ -150,7 +150,7 @@ } void spiInit(uint8_t spiRate) { - + SSP_Cmd(LPC_SSP0, DISABLE); // Disable SSP0 before changing rate // table to convert Marlin spiRates (0-5 plus default) into bit rates uint32_t Marlin_speed[7]; // CPSR is always 2 Marlin_speed[0] = 8333333; //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED @@ -242,6 +242,21 @@ void SPIClass::begin() { spiBegin(); } +void SPIClass::beginTransaction(SPISettings cfg) { + uint8_t spiRate; + switch(cfg.spiRate()) { + case 8000000: spiRate=0 ;break; + case 4000000: spiRate=1 ;break; + case 2000000: spiRate=2 ;break; + case 1000000: spiRate=3 ;break; + case 500000: spiRate=4 ;break; + case 250000: spiRate=5 ;break; + case 125000: spiRate=6 ;break; + default: spiRate=2; break; + } + spiInit(spiRate); +} + uint8_t SPIClass::transfer(uint8_t B) { return spiTransfer(B); } diff --git a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h index a408a6c587..16299696a1 100644 --- a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h @@ -66,7 +66,7 @@ #endif #endif // SPINDLE_LASER_ENABLE -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && ENABLED(HAVE_TMC2130) && DISABLED(TMC_USE_SW_SPI) \ +#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) \ && (MB(RAMPS_14_RE_ARM_EFB) \ || MB(RAMPS_14_RE_ARM_EEB) \ || MB(RAMPS_14_RE_ARM_EFF) \ diff --git a/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp b/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp index 3bedb71e91..a92a61a8fd 100644 --- a/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp @@ -19,29 +19,20 @@ #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" -#include -#include -//#include "HAL_timers.h" -#include "fastio.h" #define GNUM 31 typedef void (*interruptCB)(void); -static interruptCB callbacksP0[GNUM]; -static interruptCB callbacksP2[GNUM]; +static interruptCB callbacksP0[GNUM] = {}; +static interruptCB callbacksP2[GNUM] = {}; extern "C" void GpioEnableInt(const uint32_t port, const uint32_t pin, const uint32_t mode); extern "C" void GpioDisableInt(const uint32_t port, const uint32_t pin); -//void deadloop(void) {} -/* Configure PIO interrupt sources */ static void __initialize() { - for (uint8_t i = 0; i < GNUM; i++) { - callbacksP0[i] = 0; - callbacksP2[i] = 0; - } + NVIC_SetPriority(EINT3_IRQn, NVIC_EncodePriority(0, 1, 0)); NVIC_EnableIRQ(EINT3_IRQn); } @@ -54,6 +45,7 @@ void attachInterrupt(const pin_t pin, void (*callback)(void), uint32_t mode) { __initialize(); ++enabled; } + uint8_t myport = LPC1768_PIN_PORT(pin), mypin = LPC1768_PIN_PIN(pin); @@ -130,60 +122,41 @@ extern "C" void GpioDisableInt(const uint32_t port, const uint32_t pin) { } } -constexpr bool isPowerOf2(const uint16_t n) { - return IS_POWER_OF_2(n); -} - -#if 0 - extern "C" void EINT3_IRQHandler () { - LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF; - TOGGLE(13); - //NVIC_ClearPendingIRQ(EINT3_IRQn); +extern "C" void EINT3_IRQHandler(void) { + // Read in all current interrupt registers. We do this once as the + // GPIO interrupt registers are on the APB bus, and this is slow. + uint32_t rise0 = LPC_GPIOINT->IO0IntStatR, + fall0 = LPC_GPIOINT->IO0IntStatF, + rise2 = LPC_GPIOINT->IO2IntStatR, + fall2 = LPC_GPIOINT->IO2IntStatF; + + // Clear the interrupts ASAP + LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF; + NVIC_ClearPendingIRQ(EINT3_IRQn); + + while (rise0 > 0) { // If multiple pins changes happened continue as long as there are interrupts pending + const uint8_t bitloc = 31 - __CLZ(rise0); // CLZ returns number of leading zeros, 31 minus that is location of first pending interrupt + if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc](); + rise0 -= _BV(bitloc); } -#else - - extern "C" void EINT3_IRQHandler(void) { - // Read in all current interrupt registers. We do this once as the - // GPIO interrupt registers are on the APB bus, and this is slow. - uint32_t rise0 = LPC_GPIOINT->IO0IntStatR, - fall0 = LPC_GPIOINT->IO0IntStatF, - rise2 = LPC_GPIOINT->IO2IntStatR, - fall2 = LPC_GPIOINT->IO2IntStatF; - // Clear the interrupts ASAP - LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF; - NVIC_ClearPendingIRQ(EINT3_IRQn); - - /* multiple pins changes happened.*/ - if (rise0) while (rise0 > 0) { // Continue as long as there are interrupts pending - const uint8_t bitloc = 31 - __CLZ(rise0); //CLZ returns number of leading zeros, 31 minus that is location of first pending interrupt - if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc](); - rise0 -= _BV(bitloc); - } - - if (fall0) while (fall0 > 0) { - const uint8_t bitloc = 31 - __CLZ(fall0); - if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc](); - fall0 -= _BV(bitloc); - } - if (rise2) while(rise2 > 0) { - const uint8_t bitloc = 31 - __CLZ(rise2); - if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc](); - //LPC_GPIOINT->IO2IntClr = 1 << bitloc; - rise2 -= _BV(bitloc); - } + while (fall0 > 0) { + const uint8_t bitloc = 31 - __CLZ(fall0); + if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc](); + fall0 -= _BV(bitloc); + } - if (fall2) while (fall2 > 0) { - const uint8_t bitloc = 31 - __CLZ(fall2); - if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc](); - //LPC_GPIOINT->IO2IntClr = 1 << bitloc; - fall2 -= _BV(bitloc); - } - //NVIC_ClearPendingIRQ(EINT3_IRQn); - //LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF; - //NVIC_ClearPendingIRQ(EINT3_IRQn); + while(rise2 > 0) { + const uint8_t bitloc = 31 - __CLZ(rise2); + if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc](); + rise2 -= _BV(bitloc); } -#endif + while (fall2 > 0) { + const uint8_t bitloc = 31 - __CLZ(fall2); + if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc](); + fall2 -= _BV(bitloc); + } +} #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h index 9167361c6d..48312ccc07 100644 --- a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h @@ -37,9 +37,6 @@ #ifndef _ENDSTOP_INTERRUPTS_H_ #define _ENDSTOP_INTERRUPTS_H_ -//Currently this is untested and broken -#error "Please disable Endstop Interrupts LPC176x is currently an unsupported platform" - #include "../../module/endstops.h" // One ISR for all EXT-Interrupts @@ -47,30 +44,57 @@ void endstop_ISR(void) { endstops.update(); } void setup_endstop_interrupts(void) { #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + #if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN) + #error "X_MAX_PIN is not an INTERRUPT capable pin." + #endif + attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); #endif #if HAS_X_MIN + #if !LPC1768_PIN_INTERRUPT_M(X_MIN_PIN) + #error "X_MIN_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); #endif #if HAS_Y_MAX + #if !LPC1768_PIN_INTERRUPT_M(Y_MAX_PIN) + #error "Y_MAX_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); #endif #if HAS_Y_MIN + #if !LPC1768_PIN_INTERRUPT_M(Y_MIN_PIN) + #error "Y_MIN_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); #endif #if HAS_Z_MAX + #if !LPC1768_PIN_INTERRUPT_M(Z_MAX_PIN) + #error "Z_MAX_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); #endif #if HAS_Z_MIN + #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN) + #error "Z_MIN_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); #endif #if HAS_Z2_MAX + #if !LPC1768_PIN_INTERRUPT_M(Z2_MAX_PIN) + #error "Z2_MAX_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); #endif #if HAS_Z2_MIN + #if !LPC1768_PIN_INTERRUPT_M(Z2_MIN_PIN) + #error "Z2_MIN_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); #endif #if HAS_Z_MIN_PROBE_PIN + #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN) + #error "Z_MIN_PROBE_PIN is not an INTERRUPT capable pin." + #endif attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); #endif } diff --git a/Marlin/src/HAL/HAL_LPC1768/fastio.h b/Marlin/src/HAL/HAL_LPC1768/fastio.h index 891cbde6fb..5f55f73c86 100644 --- a/Marlin/src/HAL/HAL_LPC1768/fastio.h +++ b/Marlin/src/HAL/HAL_LPC1768/fastio.h @@ -88,25 +88,15 @@ bool useable_hardware_PWM(pin_t pin); /// set pin as input with pulldown mode #define _PULLDOWN(IO,V) pinMode(IO, (V) ? INPUT_PULLDOWN : INPUT) -// hg42: all pins can be input or output (I hope) -// hg42: undefined pins create compile error (IO, is no pin) -// hg42: currently not used, but was used by pinsDebug - /// check if pin is an input -#define _GET_INPUT(IO) (LPC1768_PIN_PIN(IO) >= 0) +#define _GET_INPUT(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIODIR & LPC_PIN(LPC1768_PIN_PIN(IO)) != 0) /// check if pin is an output -#define _GET_OUTPUT(IO) (LPC1768_PIN_PIN(IO) >= 0) - -// hg42: GET_TIMER is used only to check if it's a PWM pin -// hg42: we cannot use USEABLE_HARDWARE_PWM because it uses a function that cannot be used statically -// hg42: instead use PWM bit from the #define +#define _GET_OUTPUT(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIODIR & LPC_PIN(LPC1768_PIN_PIN(IO)) == 0) /// check if pin is a timer -#define _GET_TIMER(IO) TRUE // could be LPC1768_PIN_PWM(IO), but there -// hg42: could be this: -// #define _GET_TIMER(IO) LPC1768_PIN_PWM(IO) -// but this is an incomplete check (12 pins are PWMable, but only 6 can be used at the same time) +/// all gpio pins are pwm capable, either interrupt or hardware pwm controlled +#define _GET_TIMER(IO) TRUE /// Read a pin wrapper #define READ(IO) _READ(IO) diff --git a/Marlin/src/HAL/HAL_LPC1768/include/Arduino.h b/Marlin/src/HAL/HAL_LPC1768/include/Arduino.h index 5f0d5f57cd..7bc26b1439 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/Arduino.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/Arduino.h @@ -69,8 +69,8 @@ typedef uint8_t byte; //Interrupts void cli(void); // Disable void sei(void); // Enable -void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode); -void detachInterrupt(uint32_t pin); +void attachInterrupt(const pin_t pin, void (*callback)(void), uint32_t mode); +void detachInterrupt(const pin_t pin); extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); extern "C" void GpioDisableInt(uint32_t port, uint32_t pin); diff --git a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.cpp similarity index 93% rename from Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp rename to Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.cpp index db1171be33..152b045d55 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.cpp @@ -109,10 +109,23 @@ void HardwareSerial::begin(uint32_t baudrate) { UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); UART_IntConfig(UARTx, UART_INTCFG_RLS, ENABLE); - if (UARTx == LPC_UART0) NVIC_EnableIRQ(UART0_IRQn); - else if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) NVIC_EnableIRQ(UART1_IRQn); - else if (UARTx == LPC_UART2) NVIC_EnableIRQ(UART2_IRQn); - else if (UARTx == LPC_UART3) NVIC_EnableIRQ(UART3_IRQn); + // Set proper priority and enable interrupts + if (UARTx == LPC_UART0) { + NVIC_SetPriority(UART0_IRQn, NVIC_EncodePriority(0, 3, 0)); + NVIC_EnableIRQ(UART0_IRQn); + } + else if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) { + NVIC_SetPriority(UART1_IRQn, NVIC_EncodePriority(0, 3, 0)); + NVIC_EnableIRQ(UART1_IRQn); + } + else if (UARTx == LPC_UART2) { + NVIC_SetPriority(UART2_IRQn, NVIC_EncodePriority(0, 3, 0)); + NVIC_EnableIRQ(UART2_IRQn); + } + else if (UARTx == LPC_UART3) { + NVIC_SetPriority(UART3_IRQn, NVIC_EncodePriority(0, 3, 0)); + NVIC_EnableIRQ(UART3_IRQn); + } RxQueueWritePos = RxQueueReadPos = 0; #if TX_BUFFER_SIZE > 0 diff --git a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h b/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.h similarity index 96% rename from Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h rename to Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.h index 1f0be8958f..f3bd2f6b42 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.h @@ -23,9 +23,9 @@ #ifndef HARDWARE_SERIAL_H_ #define HARDWARE_SERIAL_H_ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(EMERGENCY_PARSER) - #include "../../feature/emergency_parser.h" + #include "../../../feature/emergency_parser.h" #endif #include diff --git a/Marlin/src/HAL/HAL_LPC1768/include/SPI.h b/Marlin/src/HAL/HAL_LPC1768/include/SPI.h index 7de136633c..bcd2d7b54f 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/SPI.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/SPI.h @@ -31,13 +31,16 @@ class SPISettings { public: - SPISettings(int a, int b, int c) {}; + SPISettings(uint32_t speed, int, int) : spi_speed(speed) {}; + uint32_t spiRate() { return spi_speed; } + private: + uint32_t spi_speed; }; class SPIClass { public: void begin(); - void beginTransaction(SPISettings foo) {}; + void beginTransaction(SPISettings); void endTransaction() {}; uint8_t transfer(uint8_t data); uint16_t transfer16(uint16_t data); diff --git a/Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp similarity index 99% rename from Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp rename to Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp index 6051026163..607ea9dcb2 100644 --- a/Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp @@ -36,13 +36,13 @@ // Includes // //#include -#include "../../inc/MarlinConfig.h" -#include "../Delay.h" +#include "../../../inc/MarlinConfig.h" +#include "../../Delay.h" #include #include #include #include -#include "fastio.h" +#include "../fastio.h" #include "SoftwareSerial.h" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); diff --git a/Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.h b/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.h similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.h rename to Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.h diff --git a/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h b/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h index 11fdf5cc3a..de727b8bde 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h @@ -267,7 +267,7 @@ constexpr pin_t adc_pin_table[] = { // Get the digital pin for an analog index pin_t analogInputToDigitalPin(const int8_t p); - +#define digitalPinToInterrupt(pin) (pin) // Return the index of a pin number // The pin number given here is in the form ppp:nnnnn int16_t GET_PIN_MAP_INDEX(const pin_t pin); @@ -283,6 +283,7 @@ bool PWM_PIN(const pin_t p); // Test whether the pin is interruptable bool INTERRUPT_PIN(const pin_t p); +#define LPC1768_PIN_INTERRUPT_M(pin) (((pin >> 8) & 0b1) != 0) // Get the pin number at the given index pin_t GET_PIN_MAP_PIN(const int16_t ind); diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.h b/Marlin/src/HAL/HAL_STM32F1/HAL.h index f538e27609..8d459b1dbb 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.h @@ -224,7 +224,8 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); void HAL_adc_init(void); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC HAL_adc_result +#define HAL_READ_ADC() HAL_adc_result +#define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp index dff5122964..15472368e4 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp @@ -42,17 +42,19 @@ namespace HAL { namespace PersistentStore { -// Store settings in the last two pages -// Flash pages must be erased before writing, so keep track. -bool firstWrite = false; -uint32_t pageBase = EEPROM_START_ADDRESS; +namespace { + // Store settings in the last two pages + // Flash pages must be erased before writing, so keep track. + bool firstWrite = false; + uint32_t pageBase = EEPROM_START_ADDRESS; +} bool access_start() { firstWrite = true; return true; } -bool access_finish(){ +bool access_finish() { FLASH_Lock(); firstWrite = false; return true; @@ -64,9 +66,9 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { if (firstWrite) { FLASH_Unlock(); status = FLASH_ErasePage(EEPROM_PAGE0_BASE); - if (status != FLASH_COMPLETE) return false; + if (status != FLASH_COMPLETE) return true; status = FLASH_ErasePage(EEPROM_PAGE1_BASE); - if (status != FLASH_COMPLETE) return false; + if (status != FLASH_COMPLETE) return true; firstWrite = false; } @@ -76,7 +78,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { uint16_t* wordBuffer = (uint16_t *)value; while (wordsToWrite) { status = FLASH_ProgramHalfWord(pageBase + pos + (i * 2), wordBuffer[i]); - if (status != FLASH_COMPLETE) return false; + if (status != FLASH_COMPLETE) return true; wordsToWrite--; i++; } @@ -85,15 +87,15 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { if (size & 1) { uint16_t temp = value[size - 1]; status = FLASH_ProgramHalfWord(pageBase + pos + i, temp); - if (status != FLASH_COMPLETE) return false; + if (status != FLASH_COMPLETE) return true; } crc16(crc, value, size); pos += ((size + 1) & ~1); - return true; + return false; } -void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) { +bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) { for (uint16_t i = 0; i < size; i++) { byte* accessPoint = (byte*)(pageBase + pos + i); uint8_t c = *accessPoint; @@ -101,6 +103,7 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const boo crc16(crc, &c, 1); } pos += ((size + 1) & ~1); + return false; } } // PersistentStore diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp index bff4610085..a64eab076f 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp @@ -44,37 +44,35 @@ namespace HAL { namespace PersistentStore { -#define CONFIG_FILE_NAME "eeprom.dat" #define HAL_STM32F1_EEPROM_SIZE 4096 char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE]; +char eeprom_filename[] = "eeprom.dat"; + bool access_start() { if (!card.cardOK) return false; int16_t bytes_read = 0; - const char eeprom_zero = 0xFF; - card.openFile((char *)CONFIG_FILE_NAME,true); - bytes_read = card.read (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); - if (bytes_read == -1) return false; - for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++) { + constexpr char eeprom_zero = 0xFF; + card.openFile(eeprom_filename, true); + bytes_read = card.read(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); + if (bytes_read < 0) return false; + for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++) HAL_STM32F1_eeprom_content[bytes_read] = eeprom_zero; - } card.closefile(); return true; } -bool access_finish(){ +bool access_finish() { if (!card.cardOK) return false; - int16_t bytes_written = 0; - card.openFile((char *)CONFIG_FILE_NAME,true); - bytes_written = card.write (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); + card.openFile(eeprom_filename, true); + int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); card.closefile(); return (bytes_written == HAL_STM32F1_EEPROM_SIZE); } bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { - for (int i = 0; i < size; i++) { - HAL_STM32F1_eeprom_content [pos + i] = value[i]; - } + for (int i = 0; i < size; i++) + HAL_STM32F1_eeprom_content[pos + i] = value[i]; crc16(crc, value, size); pos += size; return false; diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL.h b/Marlin/src/HAL/HAL_STM32F4/HAL.h index 4eca97601e..b5beefbfe1 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F4/HAL.h @@ -228,7 +228,8 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); inline void HAL_adc_init(void) {} #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC HAL_adc_result +#define HAL_READ_ADC() HAL_adc_result +#define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); diff --git a/Marlin/src/HAL/HAL_STM32F4/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32F4/persistent_store_impl.cpp index db292bbb55..a896bded30 100644 --- a/Marlin/src/HAL/HAL_STM32F4/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/persistent_store_impl.cpp @@ -33,7 +33,6 @@ namespace HAL { namespace PersistentStore { bool access_start() { return true; } - bool access_finish() { return true; } bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { diff --git a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.h b/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.h index aace2329ef..89295a78e1 100644 --- a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.h +++ b/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.h @@ -1,24 +1,24 @@ /** -* Marlin 3D Printer Firmware -* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] -* -* Based on Sprinter and grbl. -* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -*/ + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ #ifndef WATCHDOG_STM32F4_H #define WATCHDOG_STM32F4_H diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL.h b/Marlin/src/HAL/HAL_STM32F7/HAL.h index 834641c230..c594392d88 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F7/HAL.h @@ -214,7 +214,8 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); inline void HAL_adc_init(void) {} #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC HAL_adc_result +#define HAL_READ_ADC() HAL_adc_result +#define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); diff --git a/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp b/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp index f2d14658eb..71562425b9 100644 --- a/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp +++ b/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp @@ -297,8 +297,8 @@ char TMC26XStepper::stop(void) { void TMC26XStepper::setCurrent(unsigned int current) { unsigned char current_scaling = 0; //calculate the current scaling from the max current setting (in mA) - double mASetting = (double)current, - resistor_value = (double)this->resistor; + float mASetting = (float)current, + resistor_value = (float)this->resistor; // remove vsense flag this->driver_configuration_register_value &= ~(VSENSE); // Derived from I = (cs + 1) / 32 * (Vsense / Rsense) @@ -340,8 +340,8 @@ void TMC26XStepper::setCurrent(unsigned int current) { unsigned int TMC26XStepper::getCurrent(void) { // Calculate the current according to the datasheet to be on the safe side. // This is not the fastest but the most accurate and illustrative way. - double result = (double)(stall_guard2_current_register_value & CURRENT_SCALING_PATTERN), - resistor_value = (double)this->resistor, + float result = (float)(stall_guard2_current_register_value & CURRENT_SCALING_PATTERN), + resistor_value = (float)this->resistor, voltage = (driver_configuration_register_value & VSENSE) ? 0.165 : 0.31; result = (result + 1.0) / 32.0 * voltage / resistor_value * sq(1000.0); return (unsigned int)result; @@ -739,8 +739,8 @@ unsigned char TMC26XStepper::getCurrentCSReading(void) { } unsigned int TMC26XStepper::getCurrentCurrent(void) { - double result = (double)getCurrentCSReading(), - resistor_value = (double)this->resistor, + float result = (float)getCurrentCSReading(), + resistor_value = (float)this->resistor, voltage = (driver_configuration_register_value & VSENSE)? 0.165 : 0.31; result = (result + 1.0) / 32.0 * voltage / resistor_value * sq(1000.0); return (unsigned int)result; diff --git a/Marlin/src/HAL/HAL_STM32F7/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32F7/persistent_store_impl.cpp index ac4c3e7947..0cd37b9533 100644 --- a/Marlin/src/HAL/HAL_STM32F7/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32F7/persistent_store_impl.cpp @@ -33,13 +33,8 @@ namespace HAL { namespace PersistentStore { -bool access_start() { - return true; -} - -bool access_finish(){ - return true; -} +bool access_start() { return true; } +bool access_finish() { return true; } bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { while (size--) { diff --git a/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.h b/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.h index ffdb1e092e..977f0f9b7e 100644 --- a/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.h +++ b/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.h @@ -1,24 +1,24 @@ /** -* Marlin 3D Printer Firmware -* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] -* -* Based on Sprinter and grbl. -* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -*/ + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ #ifndef WATCHDOG_STM32F7_H #define WATCHDOG_STM32F7_H diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h index dca9a1a0ce..6a11bf93c9 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h @@ -142,7 +142,8 @@ uint8_t spiRec(uint32_t chan); void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC HAL_adc_get_result() +#define HAL_READ_ADC() HAL_adc_get_result() +#define HAL_ADC_READY() true #define HAL_ANALOG_SELECT(pin) NOOP; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp index be0604dae2..550d2a851e 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp @@ -9,13 +9,8 @@ namespace HAL { namespace PersistentStore { -bool access_start() { - return true; -} - -bool access_finish() { - return true; -} +bool access_start() { return true; } +bool access_finish() { return true; } bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { while (size--) { diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index b1654cd23b..5e46d86fdc 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -712,13 +712,17 @@ void setup() { SERIAL_PROTOCOLLNPGM("start"); SERIAL_ECHO_START(); - #if ENABLED(HAVE_TMC2130) + #if HAS_DRIVER(TMC2130) tmc_init_cs_pins(); #endif - #if ENABLED(HAVE_TMC2208) + #if HAS_DRIVER(TMC2208) tmc2208_serial_begin(); #endif + #ifdef BOARD_INIT + BOARD_INIT(); + #endif + // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = HAL_get_reset_source(); if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP); @@ -893,7 +897,7 @@ void setup() { #endif #if ENABLED(POWER_LOSS_RECOVERY) - do_print_job_recovery(); + check_print_job_recovery(); #endif #if ENABLED(USE_WATCHDOG) // Reinit watchdog after HAL_get_reset_source call @@ -933,12 +937,15 @@ void loop() { for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; #endif wait_for_heatup = false; + #if ENABLED(POWER_LOSS_RECOVERY) + card.removeJobRecoveryFile(); + #endif } #endif // SDSUPPORT && ULTIPANEL if (commands_in_queue < BUFSIZE) get_available_commands(); advance_command_queue(); - endstops.report_state(); + endstops.event_handler(); idle(); } } diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index 1259a385c6..7c919f9e03 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -185,11 +185,6 @@ extern volatile bool wait_for_heatup; extern bool suspend_auto_report; #endif -#if ENABLED(AUTO_BED_LEVELING_UBL) - typedef struct { double A, B, D; } linear_fit; - linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int); -#endif - // Inactivity shutdown timer extern millis_t max_inactive_time, stepper_inactive_time; diff --git a/Marlin/src/config/default/Configuration.h b/Marlin/src/config/default/Configuration.h index 8586c4e54f..104a797cb0 100644 --- a/Marlin/src/config/default/Configuration.h +++ b/Marlin/src/config/default/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index f3a4b7f47e..b6c0db3842 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h index 7c7eb94125..6afa4a76f1 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 7 #define TEMP_SENSOR_1 0 @@ -718,6 +719,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -820,6 +822,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1394,11 +1397,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1875,7 +1877,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 78862f4a9e..ca52411aa9 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h index b679fc6652..0c5044e8ca 100644 --- a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h +++ b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Anet/A6/Configuration.h b/Marlin/src/config/examples/Anet/A6/Configuration.h index c8651aa122..25530a465c 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,14 +310,14 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ -#define TEMP_SENSOR_0 5 +#define TEMP_SENSOR_0 11 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 -#define TEMP_SENSOR_BED 5 +#define TEMP_SENSOR_BED 11 #define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -570,6 +571,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE @@ -746,6 +770,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -871,10 +896,12 @@ #if 1 // 0 for less clearance #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #else #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 3 // Z position after probing is done #endif @@ -1526,11 +1553,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -2009,7 +2035,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index 0cdc3b0923..5071f42a1e 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Anet/A8/Configuration.h b/Marlin/src/config/examples/Anet/A8/Configuration.h index 841a226003..243004e9ce 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -279,6 +279,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -310,7 +311,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -705,6 +706,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -807,6 +809,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1381,11 +1384,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1864,7 +1866,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 5a06ca0611..671e69ce91 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h index 18847e905d..0a6c03a48d 100644 --- a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h +++ b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1875,7 +1900,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h b/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h index f3a4b7f47e..b6c0db3842 100644 --- a/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h +++ b/Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h index 78a8241588..791202ee1e 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 10 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index c4b938bf66..463bda9fb3 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h index 7b7d42c0a1..c6625526b7 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 5 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 10 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h index 7bfab90ddc..705d1faa62 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h index 782f8bb2a4..8aaeee32f4 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -686,6 +687,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -788,6 +790,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1362,11 +1365,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1843,7 +1845,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index ad8a92605e..ebfb5ad4db 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h index bc198d460f..be28e9ee6b 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h @@ -95,7 +95,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -286,6 +286,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -317,7 +318,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 70 #define TEMP_SENSOR_1 0 @@ -551,6 +552,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE @@ -699,6 +723,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -801,6 +826,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 0 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index d9a850e36b..1fbef36c93 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -598,6 +599,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -840,15 +845,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -859,8 +881,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1028,23 +1052,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1090,62 +1103,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1300,25 +1280,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1364,7 +1331,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1679,9 +1646,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1718,4 +1687,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h index 3536e07727..a737bdf75c 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -686,6 +687,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -788,6 +790,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1362,11 +1365,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1843,7 +1845,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index ad8a92605e..ebfb5ad4db 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Cartesio/Configuration.h b/Marlin/src/config/examples/Cartesio/Configuration.h index 6421333b46..6999212187 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration.h +++ b/Marlin/src/config/examples/Cartesio/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -279,6 +279,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -310,7 +311,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 @@ -697,6 +698,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -799,6 +801,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1373,11 +1376,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1854,7 +1856,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index c85e2d9c58..feae417d14 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration.h b/Marlin/src/config/examples/Creality/CR-10/Configuration.h index fa5e1ebff5..23b40f86af 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -560,6 +561,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -708,6 +732,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -810,6 +835,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 10 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1384,11 +1410,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1865,7 +1890,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index 4a810e3b3b..3239f63937 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1674,9 +1641,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1713,4 +1682,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h index dcfb9db984..7a4e7505de 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -134,6 +134,10 @@ // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB + #define PIN_EXP1 65 // A11 + #define PIN_EXP2 66 // A12 + #define PIN_EXP3 11 // SERVO0_PIN + #define PIN_EXP4 12 // PS_ON_PIN #endif // Optional custom name for your RepStrap or other custom machine @@ -278,6 +282,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +314,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +555,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +726,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ #define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +829,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1375,11 +1405,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1856,7 +1885,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h index f04b19d960..0497fd01ec 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h index 43ca4c35da..475fdaef9f 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h @@ -96,7 +96,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -287,6 +287,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -318,7 +319,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -569,6 +570,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -717,6 +741,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -819,6 +844,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1393,11 +1419,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1874,7 +1899,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h index ca6b97c006..da65b374b4 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration.h b/Marlin/src/config/examples/Creality/CR-8/Configuration.h index 6454a826d1..080a8ef804 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -560,6 +561,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -708,6 +732,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ #define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -810,6 +835,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1384,11 +1410,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1865,7 +1890,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h index 02b40beefe..6101565f08 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h index 3c13a76609..f6d246a53b 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -554,6 +555,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -702,6 +726,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -804,6 +829,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1378,11 +1404,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1859,7 +1884,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h index f83add0e47..9d8249b47a 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h index c2f9ac6df1..d963848db8 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -554,6 +555,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -702,6 +726,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -804,6 +829,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1378,11 +1404,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1859,7 +1884,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h index 1cc916d5de..41ea87a49c 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h index 5d22e744da..511c6ece9a 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -560,6 +561,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -708,6 +732,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ #define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -810,6 +835,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1384,11 +1410,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1865,7 +1890,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h index 02b40beefe..6101565f08 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Einstart-S/Configuration.h b/Marlin/src/config/examples/Einstart-S/Configuration.h new file mode 100644 index 0000000000..7222773dba --- /dev/null +++ b/Marlin/src/config/examples/Einstart-S/Configuration.h @@ -0,0 +1,1945 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// User-specified version info of this build to display in [Pronterface, etc] terminal window during +// 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_CONFIG_H_AUTHOR "elsie tech corp" // Who made the changes. +#define SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 + +/** + * *** VENDORS PLEASE READ *** + * + * Marlin allows you to add a custom boot image for Graphical LCDs. + * With this option Marlin will first show your custom screen followed + * by the standard Marlin logo with version number and web URL. + * + * We encourage you to take advantage of this new feature and we also + * respecfully request that you retain the unmodified Marlin boot screen. + */ + +// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +//#define CUSTOM_STATUS_SCREEN_IMAGE + +// @section machine + +/** + * Select the serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// 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_EINSTART_S +#endif + +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "The Shining" + +// 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" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5] +#define EXTRUDERS 1 + +// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 steppers + //#define E_MUX2_PIN 44 // Needed for 5 to 8 steppers +#endif + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z { 0.0, 0.0 } +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER +#if ENABLED(PARKING_EXTRUDER) + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // Delay (ms) for magnetic field. No delay if 0 or not defined. + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // mm to move beyond the parking point to grab the extruder + #define PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking + #define HOTEND_OFFSET_Z { 0.0, 1.3 } // Z-offsets of the two hotends. The first must be 0. +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Firmware M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis + +// @section machine + +/** + * Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN + * + * 0 = No Power Switch + * 1 = ATX + * 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) + * + * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' } + */ +#define POWER_SUPPLY 0 + +#if POWER_SUPPLY > 0 + // Enable this option to leave the PSU off at startup. + // Power to steppers and heaters will need to be turned on with M80. + //#define PS_DEFAULT_OFF + + //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + #if ENABLED(AUTO_POWER_CONTROL) + #define AUTO_POWER_FANS // Turn on PSU if fans need power + #define AUTO_POWER_E_FANS + #define AUTO_POWER_CONTROLLERFAN + #define POWER_TIMEOUT 30 + #endif + +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -4 : thermocouple with AD8495 + * -3 : thermocouple with MAX31855 (only for sensor 0) + * -2 : thermocouple with MAX6675 (only for sensor 0) + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) + * 3 : Mendel-parts thermistor (4.7k pullup) + * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! + * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) + * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) + * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 11 : 100k beta 3950 1% thermistor (4.7k pullup) + * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) + * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" + * 15 : 100k thermistor calibration for JGAurora A5 hotend + * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. + * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. + * + * 666 : Custom table generated for 200K thermistor with 10k pullup on Einstart S + * + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + */ +#define TEMP_SENSOR_0 666 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_BED 0 +#define TEMP_SENSOR_CHAMBER 0 + +// Dummy thermistor constant temperature readings, for use with 998 and 999 +#define DUMMY_THERMISTOR_998_VALUE 25 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 10 // (seconds) +#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define BED_MINTEMP 5 + +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Einstart S + // Autotune M303 S180 C8 + #define DEFAULT_Kp 15.31 + #define DEFAULT_Ki 0.93 + #define DEFAULT_Kd 63.03 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//============================= PID > Bed Temperature Control =============== +//=========================================================================== + +/** + * PID Bed Heating + * + * If this option is enabled set PID constants below. + * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. + * + * The PID frequency will be the same as the extruder PWM. + * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, + * which is fine for driving a square wave into a resistive load and does not significantly + * impact FET heating. This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W + * 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 BED_LIMIT_SWITCHING + +/** + * Max Bed Power + * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). + * When set to any value below 255, enables a form of PWM to the bed that acts like a divider + * so don'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 + +#if ENABLED(PIDTEMPBED) + + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#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. +#endif // PIDTEMPBED + +// @section extruder + +/** + * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. + * Add M302 to set the minimum extrusion temperature and/or turn + * cold extrusion prevention on and off. + * + * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 170 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +//#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + +// Enable pullup for all endstops to prevent a floating state +#define ENDSTOPPULLUPS +#if DISABLED(ENDSTOPPULLUPS) + // Disable ENDSTOPPULLUPS to set pullups individually + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#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 false // 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 true // 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 X_STOP_INVERTING true +#define Y_STOP_INVERTING true +#define Z_STOP_INVERTING true + +// Enable this feature if all enabled endstop pins are interrupt-capable. +// This will remove the need to poll the interrupt pins, saving many CPU cycles. +//#define ENDSTOP_INTERRUPTS_FEATURE + +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, since they already include the 100nF capacitor.) + */ +//#define ENDSTOP_NOISE_FILTER + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * 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 + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 80, 96.337120 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] + */ +#define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 2000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 2000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 +#define DEFAULT_ZJERK 0.3 +#define DEFAULT_EJERK 5.0 + +/** + * S-Curve Acceleration + * + * This option eliminates vibration during printing by fitting a Bézier + * curve to move acceleration, producing much smoother direction changes. + * + * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained + */ +#define S_CURVE_ACCELERATION + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_ENDSTOP + * + * Enable this option for a probe connected to any pin except Z-Min. + * (By default Marlin assumes the Z-Max endstop pin.) + * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * WARNING: Setting the wrong pin may have unexpected and potentially + * disastrous consequences. Use with caution and do your homework. + * + */ +//#define Z_MIN_PROBE_ENDSTOP + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ +//#define PROBE_MANUALLY + +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + */ +//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH +#if ENABLED(BLTOUCH) + //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * readings with inductive probes and piezo sensors. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +#if ENABLED(PROBING_HEATERS_OFF) + //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) +#endif +//#define PROBING_FANS_OFF // Turn fans off when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ +#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 10 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + +// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +// The number of probes to perform at each point. +// Set to 2 for a fast/slow probe, using the second probe result. +// Set to 3 or more for slow probes, averaging the results. +//#define MULTIPLE_PROBING 2 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. + * 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_AFTER_PROBING 5 // Z position after probing is done + +#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping + +// For M851 give a range for adjusting the Z probe offset +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 1 +#define Y_ENABLE_ON 1 +#define Z_ENABLE_ON 1 +#define E_ENABLE_ON 1 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER true // Keep only the active extruder enabled. + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false + +// @section homing + +//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed + +#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. + +//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR 1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 160 +#define Y_BED_SIZE 160 + +// 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 165 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) + //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD +#endif + +/** + * Filament Runout Sensors + * Mechanical or opto endstops are used to check for the presence of filament. + * + * RAMPS-based boards use SERVO3_PIN for the first runout sensor. + * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. + * By default the firmware assumes HIGH=FILAMENT PRESENT. + */ +//#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#define AUTO_BED_LEVELING_UBL +//#define MESH_BED_LEVELING + +/** + * Normally G28 leaves leveling disabled on completion. Enable + * this option to have G28 restore the prior leveling state. + */ +//#define RESTORE_LEVELING_AFTER_G28 + +/** + * Enable detailed logging of G28, G29, M48, etc. + * Turn on with the command 'M111 S32'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // For Cartesian machines, instead of dividing moves on mesh boundaries, + // split up moves into short segments like a Delta. This follows the + // contours of the bed more closely than edge-to-edge straight moves. + #define SEGMENT_LEVELED_MOVES + #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + + /** + * Enable the G26 Mesh Validation Pattern tool. + */ + //#define G26_MESH_VALIDATION + #if ENABLED(G26_MESH_VALIDATION) + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #endif + +#endif + +#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // Set the boundaries for probing (where the probe can reach). + //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE + //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) + //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE + //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + + // Probe along the Y axis, advancing X after each column + //#define PROBE_Y_FIRST + + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Beyond the probed grid, continue the implied tilt? + // Default is to maintain the height of the nearest edge. + //#define EXTRAPOLATE_BEYOND_GRID + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh + + #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle + #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 + + //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used + // as the Z-Height correction value. + +#elif ENABLED(MESH_BED_LEVELING) + + //=========================================================================== + //=================================== Mesh ================================== + //=========================================================================== + + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment +#endif + +// Add a menu item to move between bed corners for manual bed adjustment +//#define LEVEL_BED_CORNERS + +#if ENABLED(LEVEL_BED_CORNERS) + #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling + //#define LEVEL_CENTER_TOO // Move to the center after the last corner +#endif + +/** + * Commands to execute at the end of G29 probing. + * Useful to retract or move the Z probe out of the way. + */ +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// @section calibrate + +/** + * Bed Skew Compensation + * + * This feature corrects for misalignment in the XYZ axes. + * + * Take the following steps to get the bed skew in the XY plane: + * 1. Print a test square (e.g., https://www.thingiverse.com/thing:2563185) + * 2. For XY_DIAG_AC measure the diagonal A to C + * 3. For XY_DIAG_BD measure the diagonal B to D + * 4. For XY_SIDE_AD measure the edge A to D + * + * Marlin automatically computes skew factors from these measurements. + * Skew factors may also be computed and set manually: + * + * - Compute AB : SQRT(2*AC*AC+2*BD*BD-4*AD*AD)/2 + * - XY_SKEW_FACTOR : TAN(PI/2-ACOS((AC*AC-AB*AB-AD*AD)/(2*AB*AD))) + * + * If desired, follow the same procedure for XZ and YZ. + * Use these diagrams for reference: + * + * Y Z Z + * ^ B-------C ^ B-------C ^ B-------C + * | / / | / / | / / + * | / / | / / | / / + * | A-------D | A-------D | A-------D + * +-------------->X +-------------->X +-------------->Y + * XY_SKEW_FACTOR XZ_SKEW_FACTOR YZ_SKEW_FACTOR + */ +//#define SKEW_CORRECTION + +#if ENABLED(SKEW_CORRECTION) + // Input all length measurements here: + #define XY_DIAG_AC 282.8427124746 + #define XY_DIAG_BD 282.8427124746 + #define XY_SIDE_AD 200 + + // Or, set the default skew factors directly here + // to override the above measurements: + #define XY_SKEW_FACTOR 0.0 + + //#define SKEW_CORRECTION_FOR_Z + #if ENABLED(SKEW_CORRECTION_FOR_Z) + #define XZ_DIAG_AC 282.8427124746 + #define XZ_DIAG_BD 282.8427124746 + #define YZ_DIAG_AC 282.8427124746 + #define YZ_DIAG_BD 282.8427124746 + #define YZ_SIDE_AD 200 + #define XZ_SKEW_FACTOR 0.0 + #define YZ_SKEW_FACTOR 0.0 + #endif + + // Enable this option for M852 to set skew at runtime + //#define SKEW_CORRECTION_GCODE +#endif + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section extras + +// +// EEPROM +// +// The microcontroller can store settings in the EEPROM, e.g. max velocity... +// M500 - stores parameters in EEPROM +// 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 EEPROM_SETTINGS // Enable for M500 and M501 commands +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * P1 Raise the nozzle always to Z-park height. + * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. + */ +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #define NOZZLE_CLEAN_TRIANGLES 3 + + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * SD CARD + * + * 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 + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * LCD Menu Items + * + * Disable all menus and only display the Status Screen, or + * just remove some extraneous menu items to recover space. + */ +//#define NO_LCD_MENUS +//#define SLIM_LCD_MENUS + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +//#define ENCODER_PULSES_PER_STEP 4 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. + // This LCD is known to be susceptible to electrical interference + // which scrambles the display. Pressing any button clears it up. + // This is a LCD2004 display with 5 analog buttons. + +// +// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. +// +//#define ULTRA_LCD + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// CONTROLLER TYPE: Shift register panels +// + +// +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +//============================================================================= +//======================= LCD / Controller Selection ======================= +//========================= (Graphical LCDs) ======================== +//============================================================================= + +// +// CONTROLLER TYPE: Graphical 128x64 (DOGM) +// +// IMPORTANT: The U8glib library is required for Graphical Display! +// https://github.com/olikraus/U8glib_Arduino +// + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS MINI12864 with graphic controller and SD support +// http://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +// +// Einstart S OLED SSD1306 +// +#define U8GLIB_SH1106_EINSTART + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// CONTROLLER TYPE: Standalone / Serial +// + +// +// LCD for Malyan M200 printers. +// This requires SDSUPPORT to be enabled +// +//#define MALYAN_LCD + +// +// CONTROLLER TYPE: Keypad / Add-on +// + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key +// is pressed, a value of 10.0 means 10mm per click. +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#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 +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// M240 Triggers a camera by emulating a Canon RC-1 Remote +// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ +//#define PHOTOGRAPH_PIN 23 + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * NOTE: A separate 5V power supply is required! The Neopixel LED needs + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define RGB_LED_R_PIN 34 + #define RGB_LED_G_PIN 43 + #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba) + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#endif // CONFIGURATION_H diff --git a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h new file mode 100644 index 0000000000..4023433adc --- /dev/null +++ b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h @@ -0,0 +1,1730 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#ifndef CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Hephestos 2 24V heated bed upgrade kit. +// https://store.bq.com/en/heated-bed-kit-hephestos2 +// +//#define HEPHESTOS2_HEATED_BED_KIT +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #undef TEMP_SENSOR_BED + #define TEMP_SENSOR_BED 70 + #define HEATER_BED_INVERTING true +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information in M114 +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #define EXTRUDER_RUNOUT_SPEED 1500 // mm/m + #define EXTRUDER_RUNOUT_EXTRUDE 5 // mm +#endif + +// @section temperature + +// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. +// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. +#define TEMP_SENSOR_AD595_OFFSET 0.0 +#define TEMP_SENSOR_AD595_GAIN 1.0 +#define TEMP_SENSOR_AD8495_OFFSET 0.0 +#define TEMP_SENSOR_AD8495_GAIN 1.0 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled + #define CONTROLLERFAN_SPEED 255 // 255 == full speed +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * 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 E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed + +/** + * Part-Cooling Fan Multiplexer + * + * This feature allows you to digitally multiplex the fan output. + * The multiplexer is automatically switched at tool-change. + * Set FANMUX[012]_PINs below for up to 2, 4, or 8 multiplexed fans. + */ +#define FANMUX0_PIN -1 +#define FANMUX1_PIN -1 +#define FANMUX2_PIN -1 + +/** + * M355 Case Light on-off / brightness + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #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 105 // Set default power-up brightness (0-255, requires PWM pin) + //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu + //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. + #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) + #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } + #endif +#endif + +//=========================================================================== +//============================ Mechanical Settings ========================== +//=========================================================================== + +// @section homing + +// 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 + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#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 + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#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 + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +// Enable this for dual x-carriage printers. +// A dual x-carriage design has the advantage that the inactive extruder can be parked which +// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage +// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug. +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0 (DXC_FULL_CONTROL_MODE): Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1 (DXC_AUTO_PARK_MODE) : Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2 (DXC_DUPLICATION_MODE) : Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE + + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 +#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially + +// When G28 is called, this option will make Y home before X +//#define HOME_Y_BEFORE_X + +// Enable this if X or Y can't home without homing the other axis first. +//#define CODEPENDENT_XY_HOMING + +// @section machine + +#define AXIS_RELATIVE_MODES {false, false, false, false} + +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// @section lcd + +#if ENABLED(ULTIPANEL) + #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder +#endif + +// @section extras + +// minimum time in microseconds that a movement needs to take if the buffer is emptied. +#define DEFAULT_MINSEGMENTTIME 20000 + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) + +// +// Use Junction Deviation instead of traditional Jerk Limiting +// +//#define JUNCTION_DEVIATION +#if ENABLED(JUNCTION_DEVIATION) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * 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 DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis + +// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. +// These correspond to the physical drivers, so be mindful if the order is changed. +#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value + +//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ +#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again + +// @section lcd + +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// The timeout (in ms) to return to the status screen from sub-menus +//#define LCD_TIMEOUT_TO_STATUS 15000 + +// Add an 'M73' G-code to set the current percentage +//#define LCD_SET_PROGRESS_MANUALLY + +#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) + //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing + #if ENABLED(LCD_PROGRESS_BAR) + #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar + #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message + #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) + //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it + //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar + #endif +#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY + +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU +#if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. + + // Reverse SD sort to show "more recent" files first, according to the card's FAT. + // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. + #define SDCARD_RATHERRECENTFIRST + + // Add an option in the menu to run all auto#.g files + //#define MENU_ADDAUTOSTART + + /** + * Continue after Power-Loss (Creality3D) + * + * Store the current state to the SD Card at the start of each layer + * during SD printing. If the recovery file is found at boot time, present + * an option on the LCD screen to continue the print from the last-known + * point in the file. + */ + //#define POWER_LOSS_RECOVERY + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + +#endif // SDSUPPORT + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if ENABLED(DOGLCD) + // Show SD percentage next to the progress bar + //#define DOGM_SD_PERCENT + + // Enable to save many cycles by drawing a hollow frame on the Info Screen + #define XYZ_HOLLOW_FRAME + + // Enable to save many cycles by drawing a hollow frame on Menu Screens + #define MENU_HOLLOW_FRAME + + // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_BIG_EDIT_FONT + + // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_SMALL_INFOFONT + + // Enable this option and reduce the value to optimize screen updates. + // The normal delay is 10µs. Use the lowest value that still gives a reliable display. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + #if ENABLED(U8GLIB_ST7920) + /** + * ST7920-based LCDs can emulate a 16 x 4 character display using + * the ST7920 character-generator for very fast screen updates. + * Enable LIGHTWEIGHT_UI to use this special display mode. + * + * Since LIGHTWEIGHT_UI has limited space, the position and status + * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the + * length of time to display the status message before clearing. + * + * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. + * This will prevent position updates from being displayed. + */ + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + +#endif // DOGLCD + +// @section safety + +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. +#define USE_WATCHDOG + +#if ENABLED(USE_WATCHDOG) + // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. + // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. + // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! + #define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way + #define BABYSTEP_MULTIPLICATOR 1 // Babysteps are very small. Increase for faster motion. + //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * K=0 means advance disabled. + * + * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! + * + * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. + * Larger K values will be needed for flexible filament and greater distances. + * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) + * print acceleration will be reduced during the affected moves to keep within the limit. + * + * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. + * Mention @Sebastianv650 on GitHub to alert the author of any issues. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + /** + * Specify an action command to send to the host on a recovery attempt or failure. + * Will be sent in the form '//action:ACTION_ON_G29_FAILURE', e.g. '//action:probe_failed'. + * The host must be configured to handle the action command. + */ + #define G29_ACTION_ON_RECOVER "probe_rewipe" + #define G29_ACTION_ON_FAILURE "probe_failed" +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +#if ENABLED(ARC_SUPPORT) + #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment + #define N_ARC_CORRECTION 25 // Number of intertpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +// G38.2 and G38.3 Probe Target +// Set MULTIPLE_PROBING if you want G38 to double touch +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + #define G38_MINIMUM_MOVE 0.0275 // minimum distance in mm that will produce a move (determined using the print statement in check_move) +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + *15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + */ +#define MINIMUM_STEPPER_DIR_DELAY 0 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers + * 1 : Minimum for LV8729 stepper drivers + * 2 : Minimum for DRV8825 stepper drivers + * 3 : Minimum for TB6600 stepper drivers + * 30 : Minimum for TB6560 stepper drivers + */ +#define MINIMUM_STEPPER_PULSE 2 + +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + */ +#define MAXIMUM_STEPPER_RATE 250000 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// Host Receive Buffer Size +// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. +// To use flow control, set this buffer size to at least 1024 bytes. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] +//#define RX_BUFFER_SIZE 1024 + +#if RX_BUFFER_SIZE >= 1024 + // Enable to have the controller send XON/XOFF control characters to + // the host to signal the RX buffer is becoming full. + //#define SERIAL_XON_XOFF +#endif + +#if ENABLED(SDSUPPORT) + // Enable this option to collect and display the maximum + // RX queue usage after transferring a file to SD. + //#define SERIAL_STATS_MAX_RX_QUEUED + + // Enable this option to collect and display the number + // of dropped bytes after a file transfer to SD. + //#define SERIAL_STATS_DROPPED_RX +#endif + +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// @section extras + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT // ONLY PARTIALLY TESTED +#if ENABLED(FWRETRACT) + #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over + #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define RETRACT_LENGTH 3 // Default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change + #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) + #define RETRACT_ZLIFT 0 // Default retract Z-lift + #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) + #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) +#endif + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. + #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + // This short retract is done immediately, before parking the nozzle. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + // Set to 0 for manual unloading. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. + // 0 to disable start loading and skip to fast load only + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. + // Set to 0 for manual extrusion. + // Filament can be extruded repeatedly from the Filament Change menu + // until extrusion is consistent, and to purge old filament. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. + + #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. + + //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + + //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) +#endif + +// @section tmc + +/** + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) + */ +//#define HAVE_TMC26X +#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! + //#define X_IS_TMC26X + //#define X2_IS_TMC26X + //#define Y_IS_TMC26X + //#define Y2_IS_TMC26X + //#define Z_IS_TMC26X + //#define Z2_IS_TMC26X + //#define E0_IS_TMC26X + //#define E1_IS_TMC26X + //#define E2_IS_TMC26X + //#define E3_IS_TMC26X + //#define E4_IS_TMC26X + + #define X_MAX_CURRENT 1000 // in mA + #define X_SENSE_RESISTOR 91 // in mOhms + #define X_MICROSTEPS 16 // number of microsteps + + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + +#endif + +// @section tmc_smart + +/** + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. + * + * You'll also need the TMC2130Stepper Arduino library + * (https://github.com/teemuatlut/TMC2130Stepper). + * + * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + * You may also use software SPI if you wish to use general purpose IO pins. + */ +//#define HAVE_TMC2130 +#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 +#endif + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use the reading capabilities, also connect #_SERIAL_RX_PIN + * to PDN_UART without a resistor. + * The drivers can also be used with hardware serial. + * + * You'll also need the TMC2208Stepper Arduino library + * (https://github.com/teemuatlut/TMC2208Stepper). + */ +//#define HAVE_TMC2208 +#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 +#endif + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current. + #define X_MICROSTEPS 16 // 0..256 + + #define Y_CURRENT 800 + #define Y_MICROSTEPS 16 + + #define Z_CURRENT 800 + #define Z_MICROSTEPS 16 + + #define X2_CURRENT 800 + #define X2_MICROSTEPS 16 + + #define Y2_CURRENT 800 + #define Y2_MICROSTEPS 16 + + #define Z2_CURRENT 800 + #define Z2_MICROSTEPS 16 + + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + + /** + * Use software SPI for TMC2130. + * The default SW SPI pins are defined the respective pins files, + * but you can override or define them here. + */ + //#define TMC_USE_SW_SPI + //#define TMC_SW_MOSI -1 + //#define TMC_SW_MISO -1 + //#define TMC_SW_SCK -1 + + /** + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP + + /** + * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, + * like overtemperature and short to ground. TMC2208 requires hardware serial. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 S0/1 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP needs to be enabled. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + + /** + * Use stallGuard2 to sense an obstacle and trigger an endstop. + * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * Higher values make the system LESS sensitive. + * Lower value make the system MORE sensitive. + * Too low values can lead to false positives, while too high values will collide the axis without triggering. + * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. + * M914 X/Y/Z to live tune the setting + */ + //#define SENSORLESS_HOMING // TMC2130 only + + #if ENABLED(SENSORLESS_HOMING) + #define X_HOMING_SENSITIVITY 8 + #define Y_HOMING_SENSITIVITY 8 + #define Z_HOMING_SENSITIVITY 8 + #endif + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * M915 Z Axis Calibration + * + * - Adjust Z stepper current, + * - Drive the Z axis to its physical maximum, and + * - Home Z to account for the lost steps. + * + * Use M915 Snn to specify the current. + * Use M925 Znn to add extra Z height to Z_MAX_POS. + */ + //#define TMC_Z_CALIBRATION + #if ENABLED(TMC_Z_CALIBRATION) + #define CALIBRATION_CURRENT 250 + #define CALIBRATION_EXTRA_HEIGHT 10 + #endif + + /** + * You can set your own advanced settings by filling in predefined functions. + * A list of available functions can be found on the library github page + * https://github.com/teemuatlut/TMC2130Stepper + * https://github.com/teemuatlut/TMC2208Stepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_temp_prewarn(1); \ + * stepperY.interpolate(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // TMC2130 || TMC2208 + +// @section L6470 + +/** + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) + */ + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_IS_L6470 + + #define X_MICROSTEPS 16 // number of microsteps + #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 // current in mA where the driver will detect a stall + + #define X2_MICROSTEPS 16 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + + #define Y_MICROSTEPS 16 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + + #define Y2_MICROSTEPS 16 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + + #define Z_MICROSTEPS 16 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + + #define Z2_MICROSTEPS 16 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + + #define E0_MICROSTEPS 16 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + + #define E1_MICROSTEPS 16 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + + #define E2_MICROSTEPS 16 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + + #define E3_MICROSTEPS 16 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + + #define E4_MICROSTEPS 16 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + +#endif + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_LASER_ENABLE +#if ENABLED(SPINDLE_LASER_ENABLE) + + #define SPINDLE_LASER_ENABLE_INVERT false // set to "true" if the on/off function is reversed + #define SPINDLE_LASER_PWM true // set to true if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // delay in milliseconds to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop + #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction + #define SPINDLE_INVERT_DIR false + #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + + //#define SPEED_POWER_SLOPE 0.3922 + //#define SPEED_POWER_INTERCEPT 0 + //#define SPEED_POWER_MIN 10 + //#define SPEED_POWER_MAX 100 // 0-100% +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for PLA" + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for ABS" + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + +/** + * Specify an action command to send to the host on pause and resume. + * Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_PAUSE "pause" +//#define ACTION_ON_RESUME "resume" + +//=========================================================================== +//====================== I2C Position Encoder Settings ====================== +//=========================================================================== + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reilabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper + // steps per full revolution (motor steps/rev * microstepping) + //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the + // printer will attempt to correct the error; errors + // smaller than this are ignored to minimize effects of + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_ENC_2_TICKS_UNIT 2048 + //#define I2CPE_ENC_2_TICKS_REV (16 * 200) + //#define I2CPE_ENC_2_INVERT + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behaviour. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * this setting determines the minimum update time between checks. A value of 100 works well with + * error rolling average when attempting to correct only for skips and not for vibration. + */ + #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * MAX7219 Debug Matrix + * + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. + * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + + /** + * Sample debug features + * If you add more debug displays, be careful to avoid conflicts! + */ + #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning + #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + + #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + // If you experience stuttering, reboots, etc. this option can reveal how + // tweaks made to the configuration are affecting the printer in real-time. +#endif + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behaviour is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" +#endif + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Einstart-S/readme.md b/Marlin/src/config/examples/Einstart-S/readme.md new file mode 100644 index 0000000000..56635ec7a0 --- /dev/null +++ b/Marlin/src/config/examples/Einstart-S/readme.md @@ -0,0 +1,152 @@ +## Einstart S Machine Notes + +The Einstart S is a commercial machine that ships with a proprietary firmware and "licensed" slicer program which requires the original SD card or license file (.lic/.reg) from support in order to function. The impetus for the port was that I acquired the machine on the weekend when tech support was closed. + +## Specifications: + + - Powder coated, formed steel enclosure + - Machined Aluminum internal axis support frame + - Genuine matched HIWIN rails on all axis + - Genuine Minebea NEMA17 motors (200 steps/rev) + - THC7128 3A Stepper Drivers (configured for 16 microsteps, loud) + - 160x160 magnetically coupled non-heated bed + - PLA Only Direct Drive extruder + - SH1106 OLED Display w/ Cardinal navigation + - 9533 I2C PWM RGB LED Chassis illumination + - Onboard SD-Card Support + +## Initial modifications + +### Bootloader/Marlin installation + +This machine probably doesn't ship with the arduino boot loader, so unless you reflow a 2560 on there to replace the atmega1280 like I did (to preserve the original firmware), you'll need to use ISP to do an initial firmware load and/or bootloader flash! + +It's not that bad though, you can just buy an ISP programmer with the appropriate header, or build an ISP programmer using the Arduino ISP sketch (wiring is easier if you use the "old style wiring" which utilizes the following pinout: (see the comments in the ArduinoISP sketch). + +I used an arduino Nano and a header I had lying around, but you could do the same with a nano and some dupont headers cut and soldered to the board, and taped/glued into a header. + +Triple check your pinouts, it shouldn't fry if connected backwards but if your pinout is wrong you're going to struggle for sure. + +#### ArduinoISP Sketch pinout for 10pin ISP header using "old style wiring": + +See the comments in the ArduinoISP sketch under File:Examples:ArduinoISP + +1 MOSI D11 +2 5v Vcc +3 N/C +4 GND +5 RES D10 +6 N/C +7 SCK D13 +8 N/C +9 MISO D12 +10 GND GND + +#### Einstart Motherboard ISP Header Pinout + +The 10 pin ISP Header is located to the right of the ATMEGA chip, just above the long LCD header. + +#### ISP Diagram + +<--- Face of chassis + +MOSI ( 1 ) ( 2 ) Vcc + N/C ( 3 ) ( 4 ) GND + RST ( 5 ) ( 6 ) GND + SCK ( 7 ) ( 8 ) GND +MISO ( 9 ) (10 ) GND + +Component Plugs ---> + +### Motherboard Diagram + + |1234|1234|1234|1234|12|12|12|12|12|12|12|12|12|12|123|12|1234| + --------------------------------------------------------------- +| XMOT YMOT ZMOT EMOT EF HB HE PF ZS YS XS PS BT ET PT1 TC VBRG | +| ===== ====== [DC| +|====== ====== ____ ISP IC1__ ___| +| |1280| ::::: | | |USB| +| |____| 1 |__| |___| +| BUTTON |SD | +| GDLRUO LCD |___| +|________________________[......][....................]_________| + +Legend: + +XMOT X-Motor +YMOT Y-Motor +ZMOT Z-Motor +EMOT E-Motor +EF Extruder Fan +HB Heated Bed (PWM) +HE Hot End (PWM) +PF Part Fan (PWM) +ZS Z-Endstop (Max) +YS Y-Endstop (Min) +XS X-Endstop (Min) +PS SPST Switch to enable DC 24v +BT Bed Thermistor (header not populated) +ET Extruder Thermistor +PT1 PT100 Thermocouple (not populated) +TC Thermocouple (not populated) +VBRG LED Output from PCA5933 +BUTTONS +G GND (buttons are pulled low on activation) +D DOWN +L LEFT +R RIGHT +U UP +O OK (MIDDLE) + +## Uploading Marlin firmware to a stock Einstart S + +### Summary: + +Make, buy or steal a 10 pin ISP programmer and select the appropriate programmer option via Tools:Programmer in Arduino IDE, use the Sketch:Upload Using Programmer command or Shift-Ctrl-U (vs Ctrl-U to upload via serial). + +### Detailed procedure: + +You can either load Marlin directly via ISP programmer (easiest, but requires opening the chassis every time you want to change/update firmware) or, just program the bootloader which will enable later uploads via USB. HOWEVER, to actually upload the sketch you will need one of the following: + + - ISP programming header (ArduinoISP sketch, pinout below) + - OR + - Install bootloader on atmega1280 to enable native USB uploads (also requires ISP). + - AND + - Connect button between RESET and GND on ISP header, release post compile just before upload starts. + - OR + - Install permanent modification described below, requires no button press during upload. + +### Permanent modification to enable USB uploads via Arduino IDE + +As a permanent modification to enable direct USB upload from the arduino IDE, you would need to flash the boot loader using ISP first; but then you can solder a wire or 100n capacaitor between the DTR line on the FTDI to the reset line, which is conveniently located in several places on the board. + +#### FTDI Chip Diagram (IC1) + + ______ + TXD --|1 28|--OSCO + DTR --|2 27|--OSCI + RTS --|3 26|--TEST + VCCIO--|4 25|--AGND + RXD --|5 24|--N/C + RI --|6 23|--CBUS0 + GND --|7 22|--CBUS1 + N/C --|8 21|--GND + DSR --|9 20|--Vcc + DCD --|10 19|--RES + CTS --|11 18|--GND + CBUS4--|12 17|--3V3 + CBUS2--|13 16|--USBDM + CBUS3--|14 15|--USBDP + |______| + +#### Arduino Reset Circuit + + DTR-----||----GND----/\/\/\/----Vcc + 100nf 10k + +With this modification you no longer need the reset button and you can program directly from the Arduino IDE. + +### Power notes during flashing. + +You do NOT need power connected when flashing via ISP. +You DO need power when flashing via USB Serial but you MUST time the release of the reset line to allow the upload unless you've performed the permanent modification. \ No newline at end of file diff --git a/Marlin/src/config/examples/Felix/Configuration.h b/Marlin/src/config/examples/Felix/Configuration.h index b79398bf35..8aeadeb90a 100644 --- a/Marlin/src/config/examples/Felix/Configuration.h +++ b/Marlin/src/config/examples/Felix/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -531,6 +532,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -680,6 +704,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -782,6 +807,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1356,11 +1382,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1837,7 +1862,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 00ab7db363..eb37930300 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Felix/DUAL/Configuration.h b/Marlin/src/config/examples/Felix/DUAL/Configuration.h index ba5f1e55b0..a1fd1a9fce 100644 --- a/Marlin/src/config/examples/Felix/DUAL/Configuration.h +++ b/Marlin/src/config/examples/Felix/DUAL/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -531,6 +532,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -680,6 +704,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -782,6 +807,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1356,11 +1382,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1837,7 +1862,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h index 361f185a7e..d273ae8c70 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -704,6 +705,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -806,6 +808,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 3 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 3 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1380,11 +1383,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1861,7 +1863,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h index aa1dd3d329..66e0326b75 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1679,10 +1646,11 @@ //#define MAX7219_DIN_PIN P2_13 // for RAMPS E1 on Re-ARM E1_DIR_PIN P2_13 //#define MAX7219_LOAD_PIN P2_08 // for RAMPS E1 on Re-ARM E1_STEP_PIN P2_08 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - + #define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 2 // Number of Max7219 units in chain. + #define MAX7219_ROTATE -90 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! @@ -1718,4 +1686,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h index c9fc21aa99..701bfff164 100644 --- a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -565,6 +566,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -713,6 +737,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -815,6 +840,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1389,11 +1415,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1870,7 +1895,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 858b125506..b21b159e11 100644 --- a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 6 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 6 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 1177e3cad3..1f63eaae3d 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -565,6 +566,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -714,6 +738,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -816,6 +841,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1390,11 +1416,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1871,7 +1896,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index 94821804a1..226911d180 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -565,6 +566,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -713,6 +737,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ #define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -815,6 +840,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1389,11 +1415,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1870,7 +1895,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h index 1d6a8c19ee..794f9e6176 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 5e18375ae6..c50ebe9fbc 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1710,4 +1677,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h index ae2d47433b..b07e556582 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 5e18375ae6..c50ebe9fbc 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1710,4 +1677,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h index 20ff78d9d0..a18577f838 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -702,6 +703,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -804,6 +806,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1378,11 +1381,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1859,7 +1861,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index 70f957ca54..30702b2293 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration.h b/Marlin/src/config/examples/JGAurora/A5/Configuration.h index a0b97c6aab..28d1eaa831 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration.h @@ -92,7 +92,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -283,6 +283,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -314,7 +315,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 15 // manual calibration of thermistor in JGAurora A5 hotend #define TEMP_SENSOR_1 0 @@ -562,6 +563,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -710,6 +734,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -812,6 +837,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1385,11 +1411,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1866,7 +1891,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h index a71eab4072..15040dda61 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/MakerParts/Configuration.h b/Marlin/src/config/examples/MakerParts/Configuration.h index e9fed6c7e9..123173c71e 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration.h +++ b/Marlin/src/config/examples/MakerParts/Configuration.h @@ -107,7 +107,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -298,6 +298,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -329,7 +330,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -718,6 +719,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -820,6 +822,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1394,11 +1397,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1875,7 +1877,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/MakerParts/Configuration_adv.h b/Marlin/src/config/examples/MakerParts/Configuration_adv.h index 538f637b33..7481c1b96c 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration_adv.h +++ b/Marlin/src/config/examples/MakerParts/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration.h b/Marlin/src/config/examples/Malyan/M150/Configuration.h index 792f512dba..5133bf509d 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration.h @@ -92,7 +92,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -283,6 +283,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -314,7 +315,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -718,6 +719,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -824,6 +826,7 @@ */ //#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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1402,11 +1405,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1883,7 +1885,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index cd97fedf99..42708a3427 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration.h b/Marlin/src/config/examples/Malyan/M200/Configuration.h index 105992ee74..9b3005498b 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 11 #define TEMP_SENSOR_1 0 @@ -549,6 +550,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -697,6 +721,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -799,6 +824,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1373,11 +1399,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1779,7 +1804,7 @@ // LCD for Malyan M200 printers. // This requires SDSUPPORT to be enabled // -//#define MALYAN_LCD +#define MALYAN_LCD // // CONTROLLER TYPE: Keypad / Add-on @@ -1854,7 +1879,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h index 0324882a4a..344005f523 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h index 4ddb93c90d..098b149ee6 100644 --- a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -702,6 +726,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -804,6 +829,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1378,11 +1404,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1859,7 +1884,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h index 4335127a21..f5b1ef7fda 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -702,6 +703,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -804,6 +806,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1378,11 +1381,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1859,7 +1861,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 3166336ade..70ed010df4 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration.h b/Marlin/src/config/examples/Mks/Sbase/Configuration.h index 72c5f624a8..51dff291a9 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -105,7 +105,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 0 +#define SERIAL_PORT -1 /** * Select a secondary serial port on the board to use for communication with the host. @@ -114,7 +114,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -//#define SERIAL_PORT_2 -1 +//#define SERIAL_PORT_2 0 /** * This setting determines the communication speed of the printer. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index ee8ab05db7..730d613f87 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -591,6 +592,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -840,15 +845,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 4 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -859,8 +881,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1028,23 +1052,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1090,62 +1103,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1300,25 +1280,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1364,7 +1331,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1679,9 +1646,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1718,4 +1687,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h index 2f3764d99e..f0217ec30a 100644 --- a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h +++ b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -738,6 +762,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -840,6 +865,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1423,11 +1449,10 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1904,7 +1929,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h index 4a337333d8..1dd0e41fe5 100644 --- a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/RigidBot/Configuration.h b/Marlin/src/config/examples/RigidBot/Configuration.h index 96203ea78a..5379744fd6 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration.h +++ b/Marlin/src/config/examples/RigidBot/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -281,6 +281,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -312,7 +313,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 // DGlass3D = 5; RigidBot = 1; 3DSv6 = 5 #define TEMP_SENSOR_1 0 @@ -696,6 +697,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -798,6 +800,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1372,11 +1375,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index 3da6611f04..6e78a59dc0 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/SCARA/Configuration.h b/Marlin/src/config/examples/SCARA/Configuration.h index 956df12e33..50497c9ba5 100644 --- a/Marlin/src/config/examples/SCARA/Configuration.h +++ b/Marlin/src/config/examples/SCARA/Configuration.h @@ -118,7 +118,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -309,6 +309,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -340,7 +341,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -521,23 +522,23 @@ // Specify here all the endstop connectors that are connected to any endstop or probe. // Almost all printers will be using one per axis. Probes will use one or more of the // extra connectors. Leave undefined any used for non-endstop and non-probe purposes. -#define USE_XMIN_PLUG -#define USE_YMIN_PLUG +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG #define USE_ZMIN_PLUG -//#define USE_XMAX_PLUG -//#define USE_YMAX_PLUG +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG // Enable pullup for all endstops to prevent a floating state //#define ENDSTOPPULLUPS #if DISABLED(ENDSTOPPULLUPS) // Disable ENDSTOPPULLUPS to set pullups individually - //#define ENDSTOPPULLUP_XMAX - //#define ENDSTOPPULLUP_YMAX - #define ENDSTOPPULLUP_ZMAX // open pin, inverted - #define ENDSTOPPULLUP_XMIN // open pin, inverted - #define ENDSTOPPULLUP_YMIN // open pin, inverted - //#define ENDSTOPPULLUP_ZMIN + #define ENDSTOPPULLUP_XMAX + #define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX // open pin, inverted + //#define ENDSTOPPULLUP_XMIN // open pin, inverted + //#define ENDSTOPPULLUP_YMIN // open pin, inverted + #define ENDSTOPPULLUP_ZMIN //#define ENDSTOPPULLUP_ZMIN_PROBE #endif @@ -711,6 +712,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -813,6 +815,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1387,11 +1390,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1868,7 +1870,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 59351c734c..4449e6a017 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/STM32F10/Configuration.h b/Marlin/src/config/examples/STM32F10/Configuration.h index f96e34dc30..76efc90bb9 100644 --- a/Marlin/src/config/examples/STM32F10/Configuration.h +++ b/Marlin/src/config/examples/STM32F10/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #warning temp_sensor set to 998/999 (fake) #define TEMP_SENSOR_0 999 @@ -552,6 +553,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -700,6 +724,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -802,6 +827,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1376,11 +1402,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1857,7 +1882,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/STM32F4/Configuration.h b/Marlin/src/config/examples/STM32F4/Configuration.h index b6971ab744..00fb09416b 100644 --- a/Marlin/src/config/examples/STM32F4/Configuration.h +++ b/Marlin/src/config/examples/STM32F4/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration.h b/Marlin/src/config/examples/Sanguinololu/Configuration.h index 791aae3f86..a8ec8b1df9 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -729,6 +753,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -831,6 +856,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1405,11 +1431,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1886,7 +1911,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index 5f3b3a50cb..af32036691 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/TheBorg/Configuration.h b/Marlin/src/config/examples/TheBorg/Configuration.h index 93dfeb0c6e..8da6fa860e 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration.h +++ b/Marlin/src/config/examples/TheBorg/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/TheBorg/Configuration_adv.h b/Marlin/src/config/examples/TheBorg/Configuration_adv.h index d7bdbcd4f8..45560ea42e 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration_adv.h +++ b/Marlin/src/config/examples/TheBorg/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,125 +1044,80 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -#define HAVE_TMC26X - -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - #define X_IS_TMC26X - //#define X2_IS_TMC26X - #define Y_IS_TMC26X - //#define Y2_IS_TMC26X - #define Z_IS_TMC26X - #define Z2_IS_TMC26X - #define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X - - #define X_MAX_CURRENT 1200 // in mA - #define X_SENSE_RESISTOR 50 // in mOhms - #define X_MICROSTEPS 32 // number of microsteps - - #define X2_MAX_CURRENT 1200 - #define X2_SENSE_RESISTOR 50 - #define X2_MICROSTEPS 32 - - #define Y_MAX_CURRENT 1200 - #define Y_SENSE_RESISTOR 50 - #define Y_MICROSTEPS 32 - - #define Y2_MAX_CURRENT 1200 - #define Y2_SENSE_RESISTOR 50 - #define Y2_MICROSTEPS 32 - - #define Z_MAX_CURRENT 1200 - #define Z_SENSE_RESISTOR 50 - #define Z_MICROSTEPS 32 - - #define Z2_MAX_CURRENT 1200 - #define Z2_SENSE_RESISTOR 50 - #define Z2_MICROSTEPS 32 - - #define E0_MAX_CURRENT 1200 - #define E0_SENSE_RESISTOR 50 - #define E0_MICROSTEPS 32 - - #define E1_MAX_CURRENT 1200 - #define E1_SENSE_RESISTOR 50 - #define E1_MICROSTEPS 32 - - #define E2_MAX_CURRENT 1200 - #define E2_SENSE_RESISTOR 50 - #define E2_MICROSTEPS 32 - - #define E3_MAX_CURRENT 1200 - #define E3_SENSE_RESISTOR 50 - #define E3_MICROSTEPS 32 - - #define E4_MAX_CURRENT 1200 - #define E4_SENSE_RESISTOR 50 - #define E4_MICROSTEPS 32 +#if HAS_DRIVER(TMC26X) -#endif + #define X_MAX_CURRENT 1000 // in mA + #define X_SENSE_RESISTOR 91 // in mOhms + #define X_MICROSTEPS 16 // number of microsteps + + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1293,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1357,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1672,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1711,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration.h b/Marlin/src/config/examples/TinyBoy2/Configuration.h index bb937c67b7..5b9e13ea03 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration.h @@ -103,7 +103,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -300,6 +300,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -331,7 +332,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -601,9 +602,32 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. -#define ENDSTOP_INTERRUPTS_FEATURE +//#define ENDSTOP_INTERRUPTS_FEATURE /** * Endstop Noise Filter @@ -749,6 +773,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -851,6 +876,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1430,11 +1456,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1911,7 +1936,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index b5dc6bd095..4d35980bfe 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Tronxy/X1/Configuration.h b/Marlin/src/config/examples/Tronxy/X1/Configuration.h index cafc48dbe9..759178b033 100644 --- a/Marlin/src/config/examples/Tronxy/X1/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X1/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 11 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration.h new file mode 100644 index 0000000000..c6c64da3e4 --- /dev/null +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration.h @@ -0,0 +1,1935 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// User-specified version info of this build to display in [Pronterface, etc] terminal window during +// 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_CONFIG_H_AUTHOR "(Schullebernd, Tronxy X3A)" // Who made the changes. +#define SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 + +/** + * *** VENDORS PLEASE READ *** + * + * Marlin allows you to add a custom boot image for Graphical LCDs. + * With this option Marlin will first show your custom screen followed + * by the standard Marlin logo with version number and web URL. + * + * We encourage you to take advantage of this new feature and we also + * respectfully request that you retain the unmodified Marlin boot screen. + */ + +// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +//#define CUSTOM_STATUS_SCREEN_IMAGE + +// @section machine + +/** + * Select the serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// 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_MELZI //63 +#endif + +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "Tronxy X3A" + +// 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" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5] +#define EXTRUDERS 1 + +// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 steppers + //#define E_MUX2_PIN 44 // Needed for 5 to 8 steppers +#endif + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z { 0.0, 0.0 } +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER +#if ENABLED(PARKING_EXTRUDER) + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // Delay (ms) for magnetic field. No delay if 0 or not defined. + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // mm to move beyond the parking point to grab the extruder + #define PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking + #define HOTEND_OFFSET_Z { 0.0, 1.3 } // Z-offsets of the two hotends. The first must be 0. +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Firmware M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis + +// @section machine + +/** + * Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN + * + * 0 = No Power Switch + * 1 = ATX + * 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) + * + * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' } + */ +#define POWER_SUPPLY 0 + +#if POWER_SUPPLY > 0 + // Enable this option to leave the PSU off at startup. + // Power to steppers and heaters will need to be turned on with M80. + //#define PS_DEFAULT_OFF + + //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + #if ENABLED(AUTO_POWER_CONTROL) + #define AUTO_POWER_FANS // Turn on PSU if fans need power + #define AUTO_POWER_E_FANS + #define AUTO_POWER_CONTROLLERFAN + #define POWER_TIMEOUT 30 + #endif + +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -4 : thermocouple with AD8495 + * -3 : thermocouple with MAX31855 (only for sensor 0) + * -2 : thermocouple with MAX6675 (only for sensor 0) + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) + * 3 : Mendel-parts thermistor (4.7k pullup) + * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! + * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) + * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) + * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 11 : 100k beta 3950 1% thermistor (4.7k pullup) + * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) + * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" + * 15 : 100k thermistor calibration for JGAurora A5 hotend + * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. + * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. + * + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + */ +#define TEMP_SENSOR_0 6 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_BED 501 +#define TEMP_SENSOR_CHAMBER 0 + +// Dummy thermistor constant temperature readings, for use with 998 and 999 +#define DUMMY_THERMISTOR_998_VALUE 25 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 10 // (seconds) +#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define BED_MINTEMP 5 + +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define BED_MAXTEMP 130 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // 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 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//============================= PID > Bed Temperature Control =============== +//=========================================================================== + +/** + * PID Bed Heating + * + * If this option is enabled set PID constants below. + * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. + * + * The PID frequency will be the same as the extruder PWM. + * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, + * which is fine for driving a square wave into a resistive load and does not significantly + * impact FET heating. This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W + * 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 BED_LIMIT_SWITCHING + +/** + * Max Bed Power + * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). + * When set to any value below 255, enables a form of PWM to the bed that acts like a divider + * so don'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 + +#if ENABLED(PIDTEMPBED) + + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#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. +#endif // PIDTEMPBED + +// @section extruder + +/** + * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. + * Add M302 to set the minimum extrusion temperature and/or turn + * cold extrusion prevention on and off. + * + * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 170 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 210 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// Enable pullup for all endstops to prevent a floating state +#define ENDSTOPPULLUPS +#if DISABLED(ENDSTOPPULLUPS) + // Disable ENDSTOPPULLUPS to set pullups individually + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#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 true // set to true to invert the logic of the probe. + +// Enable this feature if all enabled endstop pins are interrupt-capable. +// This will remove the need to poll the interrupt pins, saving many CPU cycles. +//#define ENDSTOP_INTERRUPTS_FEATURE + +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, since they already include the 100nF capacitor.) + */ +//#define ENDSTOP_NOISE_FILTER + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * 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 + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 90 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] + */ +#define DEFAULT_MAX_FEEDRATE { 400, 400, 4, 50 } + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] + */ +#define DEFAULT_MAX_ACCELERATION { 1000, 1000, 1500, 5000 } + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // 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 + +/** + * Default Jerk (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define DEFAULT_XJERK 15.0 +#define DEFAULT_YJERK 15.0 +#define DEFAULT_ZJERK 0.4 +#define DEFAULT_EJERK 5.0 + +/** + * S-Curve Acceleration + * + * This option eliminates vibration during printing by fitting a Bézier + * curve to move acceleration, producing much smoother direction changes. + * + * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained + */ +//#define S_CURVE_ACCELERATION + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_ENDSTOP + * + * Enable this option for a probe connected to any pin except Z-Min. + * (By default Marlin assumes the Z-Max endstop pin.) + * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * WARNING: Setting the wrong pin may have unexpected and potentially + * disastrous consequences. Use with caution and do your homework. + * + */ +//#define Z_MIN_PROBE_ENDSTOP + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ +//#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 + +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +#define FIX_MOUNTED_PROBE + +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + */ +//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH +#if ENABLED(BLTOUCH) + //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * readings with inductive probes and piezo sensors. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +#if ENABLED(PROBING_HEATERS_OFF) + //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) +#endif +//#define PROBING_FANS_OFF // Turn fans off when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ +#define X_PROBE_OFFSET_FROM_EXTRUDER -32 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -0.5 // Z offset: -below +above [the nozzle] + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 50 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 6000 + +// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +// The number of probes to perform at each point. +// Set to 2 for a fast/slow probe, using the second probe result. +// Set to 3 or more for slow probes, averaging the results. +#define MULTIPLE_PROBING 2 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. + * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 + +#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping + +// For M851 give a range for adjusting the Z probe offset +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER true // Keep only the active extruder enabled. + +// @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 false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false + +// @section homing + +//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed + +//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. + +//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 + +// Tronxy X3A specific offsets +#define TRONXY_X_BED_OFFSET -17 +#define TRONXY_Y_BED_OFFSET -25 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS TRONXY_X_BED_OFFSET +#define Y_MIN_POS TRONXY_Y_BED_OFFSET +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE - (2 * TRONXY_X_BED_OFFSET) +#define Y_MAX_POS Y_BED_SIZE - (TRONXY_Y_BED_OFFSET + 5) +#define Z_MAX_POS 316 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) + //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD +#endif + +/** + * Filament Runout Sensors + * Mechanical or opto endstops are used to check for the presence of filament. + * + * RAMPS-based boards use SERVO3_PIN for the first runout sensor. + * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. + * By default the firmware assumes HIGH=FILAMENT PRESENT. + */ +//#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#define AUTO_BED_LEVELING_UBL +//#define MESH_BED_LEVELING + +/** + * Normally G28 leaves leveling disabled on completion. Enable + * this option to have G28 restore the prior leveling state. + */ +//#define RESTORE_LEVELING_AFTER_G28 + +/** + * Enable detailed logging of G28, G29, M48, etc. + * Turn on with the command 'M111 S32'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // For Cartesian machines, instead of dividing moves on mesh boundaries, + // split up moves into short segments like a Delta. This follows the + // contours of the bed more closely than edge-to-edge straight moves. + #define SEGMENT_LEVELED_MOVES + #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + + /** + * Enable the G26 Mesh Validation Pattern tool. + */ + //#define G26_MESH_VALIDATION + #if ENABLED(G26_MESH_VALIDATION) + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #endif + +#endif + +#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // Set the boundaries for probing (where the probe can reach). + //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE + //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) + //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE + //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + + // Probe along the Y axis, advancing X after each column + //#define PROBE_Y_FIRST + + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Beyond the probed grid, continue the implied tilt? + // Default is to maintain the height of the nearest edge. + //#define EXTRAPOLATE_BEYOND_GRID + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh + + #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle + #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 + + //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used + // as the Z-Height correction value. + +#elif ENABLED(MESH_BED_LEVELING) + + //=========================================================================== + //=================================== Mesh ================================== + //=========================================================================== + + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment +#endif + +// Add a menu item to move between bed corners for manual bed adjustment +//#define LEVEL_BED_CORNERS + +#if ENABLED(LEVEL_BED_CORNERS) + #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling + //#define LEVEL_CENTER_TOO // Move to the center after the last corner +#endif + +/** + * Commands to execute at the end of G29 probing. + * Useful to retract or move the Z probe out of the way. + */ +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +#define MANUAL_X_HOME_POS TRONXY_X_BED_OFFSET // The X3A has a standard X offset (17mm) between the left endstop and bed left bed edge +#define MANUAL_Y_HOME_POS TRONXY_Y_BED_OFFSET // The X3A has a standard Y offset (25mm) between the y endstop and the front bet edge +#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (100*60) +#define HOMING_FEEDRATE_Z (4*60) + +// @section calibrate + +/** + * Bed Skew Compensation + * + * This feature corrects for misalignment in the XYZ axes. + * + * Take the following steps to get the bed skew in the XY plane: + * 1. Print a test square (e.g., https://www.thingiverse.com/thing:2563185) + * 2. For XY_DIAG_AC measure the diagonal A to C + * 3. For XY_DIAG_BD measure the diagonal B to D + * 4. For XY_SIDE_AD measure the edge A to D + * + * Marlin automatically computes skew factors from these measurements. + * Skew factors may also be computed and set manually: + * + * - Compute AB : SQRT(2*AC*AC+2*BD*BD-4*AD*AD)/2 + * - XY_SKEW_FACTOR : TAN(PI/2-ACOS((AC*AC-AB*AB-AD*AD)/(2*AB*AD))) + * + * If desired, follow the same procedure for XZ and YZ. + * Use these diagrams for reference: + * + * Y Z Z + * ^ B-------C ^ B-------C ^ B-------C + * | / / | / / | / / + * | / / | / / | / / + * | A-------D | A-------D | A-------D + * +-------------->X +-------------->X +-------------->Y + * XY_SKEW_FACTOR XZ_SKEW_FACTOR YZ_SKEW_FACTOR + */ +//#define SKEW_CORRECTION + +#if ENABLED(SKEW_CORRECTION) + // Input all length measurements here: + #define XY_DIAG_AC 282.8427124746 + #define XY_DIAG_BD 282.8427124746 + #define XY_SIDE_AD 200 + + // Or, set the default skew factors directly here + // to override the above measurements: + #define XY_SKEW_FACTOR 0.0 + + //#define SKEW_CORRECTION_FOR_Z + #if ENABLED(SKEW_CORRECTION_FOR_Z) + #define XZ_DIAG_AC 282.8427124746 + #define XZ_DIAG_BD 282.8427124746 + #define YZ_DIAG_AC 282.8427124746 + #define YZ_DIAG_BD 282.8427124746 + #define YZ_SIDE_AD 200 + #define XZ_SKEW_FACTOR 0.0 + #define YZ_SKEW_FACTOR 0.0 + #endif + + // Enable this option for M852 to set skew at runtime + //#define SKEW_CORRECTION_GCODE +#endif + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section extras + +// +// EEPROM +// +// The microcontroller can store settings in the EEPROM, e.g. max velocity... +// M500 - stores parameters in EEPROM +// 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 EEPROM_SETTINGS // Enable for M500 and M501 commands +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +//#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_TEMP_HOTEND 210 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_TEMP_HOTEND 225 +#define PREHEAT_2_TEMP_BED 85 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * P1 Raise the nozzle always to Z-park height. + * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. + */ +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #define NOZZLE_CLEAN_TRIANGLES 3 + + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, + * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, + * tr, uk, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * SD CARD + * + * 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 + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * LCD Menu Items + * + * Disable all menus and only display the Status Screen, or + * just remove some extraneous menu items to recover space. + */ +//#define NO_LCD_MENUS +//#define SLIM_LCD_MENUS + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +//#define ENCODER_PULSES_PER_STEP 4 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. + // This LCD is known to be susceptible to electrical interference + // which scrambles the display. Pressing any button clears it up. + // This is a LCD2004 display with 5 analog buttons. + +// +// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. +// +//#define ULTRA_LCD + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// CONTROLLER TYPE: Shift register panels +// + +// +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +//============================================================================= +//======================= LCD / Controller Selection ======================= +//========================= (Graphical LCDs) ======================== +//============================================================================= + +// +// CONTROLLER TYPE: Graphical 128x64 (DOGM) +// +// IMPORTANT: The U8glib library is required for Graphical Display! +// https://github.com/olikraus/U8glib_Arduino +// + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + //#define U8GLIB_SSD1306 + #define U8GLIB_SH1106 +#endif + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS MINI12864 with graphic controller and SD support +// http://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// CONTROLLER TYPE: Standalone / Serial +// + +// +// LCD for Malyan M200 printers. +// This requires SDSUPPORT to be enabled +// +//#define MALYAN_LCD + +// +// CONTROLLER TYPE: Keypad / Add-on +// + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key +// is pressed, a value of 10.0 means 10mm per click. +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#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 +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// M240 Triggers a camera by emulating a Canon RC-1 Remote +// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ +//#define PHOTOGRAPH_PIN 23 + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * NOTE: A separate 5V power supply is required! The Neopixel LED needs + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define RGB_LED_R_PIN 34 + #define RGB_LED_G_PIN 43 + #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba) + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#endif // CONFIGURATION_H diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h new file mode 100644 index 0000000000..250028be7c --- /dev/null +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h @@ -0,0 +1,1685 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#ifndef CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Hephestos 2 24V heated bed upgrade kit. +// https://store.bq.com/en/heated-bed-kit-hephestos2 +// +//#define HEPHESTOS2_HEATED_BED_KIT +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #undef TEMP_SENSOR_BED + #define TEMP_SENSOR_BED 70 + #define HEATER_BED_INVERTING true +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 40 // Seconds + #define WATCH_TEMP_INCREASE 10 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 10 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information in M114 +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #define EXTRUDER_RUNOUT_SPEED 1500 // mm/m + #define EXTRUDER_RUNOUT_EXTRUDE 5 // mm +#endif + +// @section temperature + +// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. +// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. +#define TEMP_SENSOR_AD595_OFFSET 0.0 +#define TEMP_SENSOR_AD595_GAIN 1.0 +#define TEMP_SENSOR_AD8495_OFFSET 0.0 +#define TEMP_SENSOR_AD8495_GAIN 1.0 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled + #define CONTROLLERFAN_SPEED 255 // 255 == full speed +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * 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 E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed + +/** + * Part-Cooling Fan Multiplexer + * + * This feature allows you to digitally multiplex the fan output. + * The multiplexer is automatically switched at tool-change. + * Set FANMUX[012]_PINs below for up to 2, 4, or 8 multiplexed fans. + */ +#define FANMUX0_PIN -1 +#define FANMUX1_PIN -1 +#define FANMUX2_PIN -1 + +/** + * M355 Case Light on-off / brightness + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #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 105 // Set default power-up brightness (0-255, requires PWM pin) + //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu + //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. + #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) + #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } + #endif +#endif + +//=========================================================================== +//============================ Mechanical Settings ========================== +//=========================================================================== + +// @section homing + +// 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 + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#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 + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#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 + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +// Enable this for dual x-carriage printers. +// A dual x-carriage design has the advantage that the inactive extruder can be parked which +// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage +// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug. +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0 (DXC_FULL_CONTROL_MODE): Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1 (DXC_AUTO_PARK_MODE) : Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2 (DXC_DUPLICATION_MODE) : Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE + + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 +#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially + +// When G28 is called, this option will make Y home before X +//#define HOME_Y_BEFORE_X + +// Enable this if X or Y can't home without homing the other axis first. +//#define CODEPENDENT_XY_HOMING + +// @section machine + +#define AXIS_RELATIVE_MODES {false, false, false, false} + +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// @section lcd + +#if ENABLED(ULTIPANEL) + #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder +#endif + +// @section extras + +// minimum time in microseconds that a movement needs to take if the buffer is emptied. +#define DEFAULT_MINSEGMENTTIME 20000 + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) + +// +// Use Junction Deviation instead of traditional Jerk Limiting +// +//#define JUNCTION_DEVIATION +#if ENABLED(JUNCTION_DEVIATION) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * 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 DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis + +// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. +// These correspond to the physical drivers, so be mindful if the order is changed. +#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value + +//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ +#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again + +// @section lcd + +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// The timeout (in ms) to return to the status screen from sub-menus +//#define LCD_TIMEOUT_TO_STATUS 15000 + +// Add an 'M73' G-code to set the current percentage +//#define LCD_SET_PROGRESS_MANUALLY + +#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) + //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing + #if ENABLED(LCD_PROGRESS_BAR) + #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar + #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message + #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) + //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it + //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar + #endif +#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY + +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU +#if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. + + // Reverse SD sort to show "more recent" files first, according to the card's FAT. + // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. + #define SDCARD_RATHERRECENTFIRST + + // Add an option in the menu to run all auto#.g files + //#define MENU_ADDAUTOSTART + + /** + * Continue after Power-Loss (Creality3D) + * + * Store the current state to the SD Card at the start of each layer + * during SD printing. If the recovery file is found at boot time, present + * an option on the LCD screen to continue the print from the last-known + * point in the file. + */ + //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + +#endif // SDSUPPORT + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if ENABLED(DOGLCD) + // Show SD percentage next to the progress bar + //#define DOGM_SD_PERCENT + + // Enable to save many cycles by drawing a hollow frame on the Info Screen + #define XYZ_HOLLOW_FRAME + + // Enable to save many cycles by drawing a hollow frame on Menu Screens + #define MENU_HOLLOW_FRAME + + // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_BIG_EDIT_FONT + + // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_SMALL_INFOFONT + + // Enable this option and reduce the value to optimize screen updates. + // The normal delay is 10µs. Use the lowest value that still gives a reliable display. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + #if ENABLED(U8GLIB_ST7920) + /** + * ST7920-based LCDs can emulate a 16 x 4 character display using + * the ST7920 character-generator for very fast screen updates. + * Enable LIGHTWEIGHT_UI to use this special display mode. + * + * Since LIGHTWEIGHT_UI has limited space, the position and status + * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the + * length of time to display the status message before clearing. + * + * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. + * This will prevent position updates from being displayed. + */ + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + +#endif // DOGLCD + +// @section safety + +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. +#define USE_WATCHDOG + +#if ENABLED(USE_WATCHDOG) + // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. + // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. + // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! + #define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way + #define BABYSTEP_MULTIPLICATOR 1 // Babysteps are very small. Increase for faster motion. + //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * K=0 means advance disabled. + * + * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! + * + * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. + * Larger K values will be needed for flexible filament and greater distances. + * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) + * print acceleration will be reduced during the affected moves to keep within the limit. + * + * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. + * Mention @Sebastianv650 on GitHub to alert the author of any issues. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + /** + * Specify an action command to send to the host on a recovery attempt or failure. + * Will be sent in the form '//action:ACTION_ON_G29_FAILURE', e.g. '//action:probe_failed'. + * The host must be configured to handle the action command. + */ + #define G29_ACTION_ON_RECOVER "probe_rewipe" + #define G29_ACTION_ON_FAILURE "probe_failed" +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +#if ENABLED(ARC_SUPPORT) + #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment + #define N_ARC_CORRECTION 25 // Number of intertpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +// G38.2 and G38.3 Probe Target +// Set MULTIPLE_PROBING if you want G38 to double touch +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + #define G38_MINIMUM_MOVE 0.0275 // minimum distance in mm that will produce a move (determined using the print statement in check_move) +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers + * 1 : Minimum for LV8729 stepper drivers + * 2 : Minimum for DRV8825 stepper drivers + * 3 : Minimum for TB6600 stepper drivers + * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_PULSE 2 + +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MAXIMUM_STEPPER_RATE 250000 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// Host Receive Buffer Size +// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. +// To use flow control, set this buffer size to at least 1024 bytes. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] +//#define RX_BUFFER_SIZE 1024 + +#if RX_BUFFER_SIZE >= 1024 + // Enable to have the controller send XON/XOFF control characters to + // the host to signal the RX buffer is becoming full. + //#define SERIAL_XON_XOFF +#endif + +#if ENABLED(SDSUPPORT) + // Enable this option to collect and display the maximum + // RX queue usage after transferring a file to SD. + //#define SERIAL_STATS_MAX_RX_QUEUED + + // Enable this option to collect and display the number + // of dropped bytes after a file transfer to SD. + //#define SERIAL_STATS_DROPPED_RX +#endif + +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// @section extras + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT // ONLY PARTIALLY TESTED +#if ENABLED(FWRETRACT) + #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over + #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define RETRACT_LENGTH 3 // Default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change + #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) + #define RETRACT_ZLIFT 0 // Default retract Z-lift + #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) + #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) +#endif + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. + #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + // This short retract is done immediately, before parking the nozzle. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + // Set to 0 for manual unloading. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. + // 0 to disable start loading and skip to fast load only + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. + // Set to 0 for manual extrusion. + // Filament can be extruded repeatedly from the Filament Change menu + // until extrusion is consistent, and to purge old filament. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. + + #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. + + //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + + //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #define X_MAX_CURRENT 1000 // in mA + #define X_SENSE_RESISTOR 91 // in mOhms + #define X_MICROSTEPS 16 // number of microsteps + + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + * You may also use software SPI if you wish to use general purpose IO pins. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use the reading capabilities, also connect #_SERIAL_RX_PIN + * to PDN_UART without a resistor. + * The drivers can also be used with hardware serial. + * + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper + */ +#if HAS_TRINAMIC + + #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current. + #define X_MICROSTEPS 16 // 0..256 + + #define Y_CURRENT 800 + #define Y_MICROSTEPS 16 + + #define Z_CURRENT 800 + #define Z_MICROSTEPS 16 + + #define X2_CURRENT 800 + #define X2_MICROSTEPS 16 + + #define Y2_CURRENT 800 + #define Y2_MICROSTEPS 16 + + #define Z2_CURRENT 800 + #define Z2_MICROSTEPS 16 + + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + + /** + * Use software SPI for TMC2130. + * The default SW SPI pins are defined the respective pins files, + * but you can override or define them here. + */ + //#define TMC_USE_SW_SPI + //#define TMC_SW_MOSI -1 + //#define TMC_SW_MISO -1 + //#define TMC_SW_SCK -1 + + /** + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP + + /** + * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, + * like overtemperature and short to ground. TMC2208 requires hardware serial. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 S0/1 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP needs to be enabled. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + + /** + * Use stallGuard2 to sense an obstacle and trigger an endstop. + * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * Higher values make the system LESS sensitive. + * Lower value make the system MORE sensitive. + * Too low values can lead to false positives, while too high values will collide the axis without triggering. + * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. + * M914 X/Y/Z to live tune the setting + */ + //#define SENSORLESS_HOMING // TMC2130 only + + #if ENABLED(SENSORLESS_HOMING) + #define X_HOMING_SENSITIVITY 8 + #define Y_HOMING_SENSITIVITY 8 + #define Z_HOMING_SENSITIVITY 8 + #endif + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * M915 Z Axis Calibration + * + * - Adjust Z stepper current, + * - Drive the Z axis to its physical maximum, and + * - Home Z to account for the lost steps. + * + * Use M915 Snn to specify the current. + * Use M925 Znn to add extra Z height to Z_MAX_POS. + */ + //#define TMC_Z_CALIBRATION + #if ENABLED(TMC_Z_CALIBRATION) + #define CALIBRATION_CURRENT 250 + #define CALIBRATION_EXTRA_HEIGHT 10 + #endif + + /** + * You can set your own advanced settings by filling in predefined functions. + * A list of available functions can be found on the library github page + * https://github.com/teemuatlut/TMC2130Stepper + * https://github.com/teemuatlut/TMC2208Stepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_temp_prewarn(1); \ + * stepperY.interpolate(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // TMC2130 || TMC2208 + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + */ +#if HAS_DRIVER(L6470) + + #define X_MICROSTEPS 16 // number of microsteps + #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 // current in mA where the driver will detect a stall + + #define X2_MICROSTEPS 16 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + + #define Y_MICROSTEPS 16 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + + #define Y2_MICROSTEPS 16 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + + #define Z_MICROSTEPS 16 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + + #define Z2_MICROSTEPS 16 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + + #define E0_MICROSTEPS 16 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + + #define E1_MICROSTEPS 16 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + + #define E2_MICROSTEPS 16 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + + #define E3_MICROSTEPS 16 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + + #define E4_MICROSTEPS 16 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_LASER_ENABLE +#if ENABLED(SPINDLE_LASER_ENABLE) + + #define SPINDLE_LASER_ENABLE_INVERT false // set to "true" if the on/off function is reversed + #define SPINDLE_LASER_PWM true // set to true if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // delay in milliseconds to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop + #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction + #define SPINDLE_INVERT_DIR false + #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + + //#define SPEED_POWER_SLOPE 0.3922 + //#define SPEED_POWER_INTERCEPT 0 + //#define SPEED_POWER_MIN 10 + //#define SPEED_POWER_MAX 100 // 0-100% +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for PLA" + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for ABS" + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + +/** + * Specify an action command to send to the host on pause and resume. + * Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_PAUSE "pause" +//#define ACTION_ON_RESUME "resume" + +//=========================================================================== +//====================== I2C Position Encoder Settings ====================== +//=========================================================================== + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reilabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper + // steps per full revolution (motor steps/rev * microstepping) + //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the + // printer will attempt to correct the error; errors + // smaller than this are ignored to minimize effects of + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_ENC_2_TICKS_UNIT 2048 + //#define I2CPE_ENC_2_TICKS_REV (16 * 200) + //#define I2CPE_ENC_2_INVERT + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behaviour. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * this setting determines the minimum update time between checks. A value of 100 works well with + * error rolling average when attempting to correct only for skips and not for vibration. + */ + #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * MAX7219 Debug Matrix + * + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. + * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 + + /** + * Sample debug features + * If you add more debug displays, be careful to avoid conflicts! + */ + #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning + #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + + #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + // If you experience stuttering, reboots, etc. this option can reveal how + // tweaks made to the configuration are affecting the printer in real-time. +#endif + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behaviour is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" +#endif + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h index 44ba239360..46ad95f9a0 100644 --- a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ #define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h index 0fa57cd306..3d19372b3c 100644 --- a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -561,6 +562,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -709,6 +733,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -811,6 +836,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1385,11 +1411,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1866,7 +1891,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h index 09d6bbd453..34b0e60cfd 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE TMC2130 +#define Y_DRIVER_TYPE TMC2130 +#define Z_DRIVER_TYPE TMC2130 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2130 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1880,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h index 1e50c0178e..f19d95f53b 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration.h b/Marlin/src/config/examples/Velleman/K8200/Configuration.h index 745733b1dc..97215c9b15 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration.h @@ -103,7 +103,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -298,6 +298,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -329,7 +330,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -580,6 +581,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -727,6 +751,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -829,6 +854,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1407,11 +1433,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1890,7 +1915,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 6f8deff9e8..455689b0bb 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -343,6 +343,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -450,7 +452,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -593,6 +594,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -835,15 +840,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -854,8 +876,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1023,23 +1047,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1085,62 +1098,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1295,25 +1275,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1359,7 +1326,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1674,9 +1641,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1713,4 +1682,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Configuration.h index 794d215a7a..cf35acc388 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -866,7 +869,7 @@ // The size of the print bed #define X_BED_SIZE 200 -#define Y_BED_SIZE 200 +#define Y_BED_SIZE 180 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index 3ca8f2999a..ba58e15edd 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=18 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h index 5eaffedfe9..d5dcea666e 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 5 @@ -698,6 +699,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +802,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -866,11 +869,11 @@ // The size of the print bed #define X_BED_SIZE 200 -#define Y_BED_SIZE 200 +#define Y_BED_SIZE 180 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 -#define Y_MIN_POS 20 +#define Y_MIN_POS 0 #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE @@ -1374,11 +1377,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1855,7 +1857,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h index ed48e0d00b..e1fb3214d3 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 20 #define TEMP_SENSOR_1 0 @@ -560,6 +561,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -708,6 +732,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -810,6 +835,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1384,11 +1410,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1868,7 +1893,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 16d547804f..7c8541901e 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1712,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h index 63bb6fbf85..a5b8763b11 100644 --- a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h +++ b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -550,6 +551,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -698,6 +722,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -800,6 +825,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1374,11 +1400,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1861,7 +1886,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index 10084ef040..5b7a29d28e 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -522,6 +523,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -780,6 +784,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -932,6 +937,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 2 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1506,11 +1512,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1988,7 +1993,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 5f2f0e5df9..ba289c6b3d 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -449,7 +451,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1673,9 +1640,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1712,4 +1681,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h index 82ab7866dc..f9cc2063f1 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -522,6 +523,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -780,6 +784,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -931,6 +936,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 2 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1505,11 +1511,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1987,7 +1992,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h index ef518d9be9..55a5e34a3f 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -449,7 +451,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1673,9 +1640,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1712,4 +1681,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h index c95791a122..369dd65ff8 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -522,6 +523,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -623,6 +627,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -780,6 +807,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -931,6 +959,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1505,11 +1534,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1986,7 +2014,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 79d016523e..685fe230e3 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -449,7 +451,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1673,9 +1640,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1712,4 +1681,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h index 52429cb741..f9bb2a615f 100644 --- a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -92,7 +92,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -283,6 +283,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -314,7 +315,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -527,6 +528,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 200 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -785,6 +789,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -934,6 +939,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1508,11 +1514,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1989,7 +1994,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/generic/Configuration.h b/Marlin/src/config/examples/delta/generic/Configuration.h index 863ab7b3aa..e6360aa250 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration.h +++ b/Marlin/src/config/examples/delta/generic/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 0 @@ -512,6 +513,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 200 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -770,6 +774,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -919,6 +924,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1493,11 +1499,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1974,7 +1979,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index 79d016523e..685fe230e3 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -449,7 +451,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1673,9 +1640,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1712,4 +1681,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h index b0a8155ee1..eed168e184 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 7 #define TEMP_SENSOR_1 0 @@ -512,6 +513,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 200 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -613,6 +617,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -770,6 +797,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -921,6 +949,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1495,11 +1524,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1976,7 +2004,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index 79d016523e..685fe230e3 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -449,7 +451,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1673,9 +1640,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1712,4 +1681,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h index 1a5190c129..aad17a7c86 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h @@ -91,7 +91,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -282,6 +282,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -313,7 +314,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -498,6 +499,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -599,6 +603,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -763,6 +790,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -921,6 +949,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 100 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1496,11 +1525,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1977,7 +2005,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h index 449b9e2516..c7c643d92a 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h @@ -345,6 +345,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -454,7 +456,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -597,6 +598,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -839,15 +844,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -858,8 +880,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1027,23 +1051,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1089,62 +1102,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1299,25 +1279,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1363,7 +1330,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1678,9 +1645,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1717,4 +1686,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h index 0d742089b2..f68396106c 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -516,6 +517,9 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 + // Convert feedrates to apply to the Effector instead of the Carriages + #define DELTA_FEEDRATE_SCALING + // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -617,6 +621,29 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -773,6 +800,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -922,6 +950,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 20 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 10 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1496,11 +1525,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1977,7 +2005,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index a25bc32e59..e230776623 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -449,7 +451,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -592,6 +593,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -834,15 +839,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -853,8 +875,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1022,23 +1046,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,62 +1097,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1294,25 +1274,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1358,7 +1325,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1673,9 +1640,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1712,4 +1681,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h index 2617c6f754..d8a755e011 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -283,6 +283,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -314,7 +315,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -563,9 +564,32 @@ #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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. -#define ENDSTOP_INTERRUPTS_FEATURE +//#define ENDSTOP_INTERRUPTS_FEATURE /** * Endstop Noise Filter @@ -711,6 +735,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -813,6 +838,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 6 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 6 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1388,11 +1414,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1869,7 +1894,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index f0520426d2..efc5efd55f 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + #define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 2 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 180 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/makibox/Configuration.h b/Marlin/src/config/examples/makibox/Configuration.h index 5f1e4d8e86..57ec8ee588 100644 --- a/Marlin/src/config/examples/makibox/Configuration.h +++ b/Marlin/src/config/examples/makibox/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -553,6 +554,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -701,6 +725,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -803,6 +828,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1377,11 +1403,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1858,7 +1883,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index 8e8bb7bc18..93c931ca9b 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/stm32f103ret6/Configuration.h b/Marlin/src/config/examples/stm32f103ret6/Configuration.h index a50e53b03d..fb18c0721f 100644 --- a/Marlin/src/config/examples/stm32f103ret6/Configuration.h +++ b/Marlin/src/config/examples/stm32f103ret6/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #warning temp_sensor set to 998/999 (fake) #define TEMP_SENSOR_0 999 @@ -552,6 +553,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -700,6 +724,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -802,6 +827,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1376,11 +1402,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1857,7 +1882,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h index 5b202d729d..dd59302c2b 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -693,6 +694,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -795,6 +797,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // 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 #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1369,11 +1372,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1850,7 +1852,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index 348dec0e14..8cb3ba273a 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -590,6 +591,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -832,15 +837,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 30 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -851,8 +873,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 15000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1020,23 +1044,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1082,62 +1095,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1292,25 +1272,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1356,7 +1323,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1671,9 +1638,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features @@ -1710,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/wt150/Configuration.h b/Marlin/src/config/examples/wt150/Configuration.h index c3f1878b26..57b0905525 100644 --- a/Marlin/src/config/examples/wt150/Configuration.h +++ b/Marlin/src/config/examples/wt150/Configuration.h @@ -87,7 +87,7 @@ * by the standard Marlin logo with version number and web URL. * * We encourage you to take advantage of this new feature and we also - * respecfully request that you retain the unmodified Marlin boot screen. + * respectfully request that you retain the unmodified Marlin boot screen. */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. @@ -278,6 +278,7 @@ * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -309,7 +310,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ #define TEMP_SENSOR_0 -2 #define TEMP_SENSOR_1 0 @@ -555,6 +556,29 @@ #define Z_MAX_ENDSTOP_INVERTING true // 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. +/** + * Specify Stepper Driver types + * The options are used to determine driver pulse timings as well as more advanced functionality. + * Stepper timing options can be overridden in Configuration_adv.h + * + * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +#define X2_DRIVER_TYPE A4988 +#define Y2_DRIVER_TYPE A4988 +#define Z2_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 +#define E2_DRIVER_TYPE A4988 +#define E3_DRIVER_TYPE A4988 +#define E4_DRIVER_TYPE A4988 + // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE @@ -703,6 +727,7 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -805,6 +830,7 @@ */ #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_MULTI_PROBE 5 // Z Clearance between multiple probes //#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -1379,11 +1405,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, - * gl, hr, it, jp-kana, nl, pl, pt, pt-br, ru, sk, - * tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1860,7 +1885,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * LED Strips require a MOSFET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index 09d2229ef4..abad29a647 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -340,6 +340,8 @@ // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position @@ -447,7 +449,6 @@ //#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge - //#define JUNCTION_DEVIATION_INCLUDE_E #endif /** @@ -591,6 +592,10 @@ * point in the file. */ //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif /** * Sort SD file listings in alphabetical order. @@ -833,15 +838,32 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + /** * Minimum stepper driver pulse width (in µs) * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988 stepper drivers * 1 : Minimum for LV8729 stepper drivers * 2 : Minimum for DRV8825 stepper drivers * 3 : Minimum for TB6600 stepper drivers * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_PULSE 2 +//#define MINIMUM_STEPPER_PULSE 2 /** * Maximum stepping rate (in Hz) the stepper driver allows @@ -852,8 +874,10 @@ * 150000 : Maximum for TB6600 stepper driver * 130000 : Maximum for LV8729 stepper driver * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. */ -#define MAXIMUM_STEPPER_RATE 250000 +//#define MAXIMUM_STEPPER_RATE 250000 // @section temperature @@ -1021,23 +1045,12 @@ // @section tmc /** - * Enable this section if you have TMC26X motor drivers. - * You will need to import the TMC26XStepper library into the Arduino IDE for this - * (https://github.com/trinamic/TMC26XStepper.git) + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper */ -//#define HAVE_TMC26X -#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory! - //#define X_IS_TMC26X - //#define X2_IS_TMC26X - //#define Y_IS_TMC26X - //#define Y2_IS_TMC26X - //#define Z_IS_TMC26X - //#define Z2_IS_TMC26X - //#define E0_IS_TMC26X - //#define E1_IS_TMC26X - //#define E2_IS_TMC26X - //#define E3_IS_TMC26X - //#define E4_IS_TMC26X +#if HAS_DRIVER(TMC26X) #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1083,62 +1096,29 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif +#endif // TMC26X // @section tmc_smart /** - * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to * the hardware SPI interface on your board and define the required CS pins * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). * You may also use software SPI if you wish to use general purpose IO pins. - */ -//#define HAVE_TMC2130 -#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2130 - //#define X2_IS_TMC2130 - //#define Y_IS_TMC2130 - //#define Y2_IS_TMC2130 - //#define Z_IS_TMC2130 - //#define Z2_IS_TMC2130 - //#define E0_IS_TMC2130 - //#define E1_IS_TMC2130 - //#define E2_IS_TMC2130 - //#define E3_IS_TMC2130 - //#define E4_IS_TMC2130 -#endif - -/** - * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. - * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. * To use the reading capabilities, also connect #_SERIAL_RX_PIN * to PDN_UART without a resistor. * The drivers can also be used with hardware serial. * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper */ -//#define HAVE_TMC2208 -#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory! - //#define X_IS_TMC2208 - //#define X2_IS_TMC2208 - //#define Y_IS_TMC2208 - //#define Y2_IS_TMC2208 - //#define Z_IS_TMC2208 - //#define Z2_IS_TMC2208 - //#define E0_IS_TMC2208 - //#define E1_IS_TMC2208 - //#define E2_IS_TMC2208 - //#define E3_IS_TMC2208 - //#define E4_IS_TMC2208 -#endif - -#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) +#if HAS_TRINAMIC #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1293,25 +1273,12 @@ // @section L6470 /** - * Enable this section if you have L6470 motor drivers. - * You need to import the L6470 library into the Arduino IDE for this. - * (https://github.com/ameyer/Arduino-L6470) + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 */ - -//#define HAVE_L6470DRIVER -#if ENABLED(HAVE_L6470DRIVER) - - //#define X_IS_L6470 - //#define X2_IS_L6470 - //#define Y_IS_L6470 - //#define Y2_IS_L6470 - //#define Z_IS_L6470 - //#define Z2_IS_L6470 - //#define E0_IS_L6470 - //#define E1_IS_L6470 - //#define E2_IS_L6470 - //#define E3_IS_L6470 - //#define E4_IS_L6470 +#if HAS_DRIVER(L6470) #define X_MICROSTEPS 16 // number of microsteps #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off @@ -1357,7 +1324,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif +#endif // L6470 /** * TWI/I2C BUS @@ -1672,10 +1639,11 @@ #define MAX7219_DIN_PIN 57 #define MAX7219_LOAD_PIN 44 - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=18 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! @@ -1711,4 +1679,7 @@ #define WIFI_PWD "Wifi Password" #endif +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 9de00d064c..092fffc74c 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -63,6 +63,7 @@ #define BOARD_MKS_BASE_HEROIC 41 // MKS BASE 1.0 with Heroic HR4982 stepper drivers #define BOARD_MKS_GEN_13 47 // MKS GEN v1.3 or 1.4 #define BOARD_MKS_GEN_L 53 // MKS GEN L +#define BOARD_KFB_2 136 // Bigtreetech or BIQU KFB2.0 #define BOARD_ZRIB_V20 504 // zrib V2.0 control board (Chinese knock off RAMPS replica) #define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) #define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard @@ -104,6 +105,7 @@ #define BOARD_SCOOVO_X9H 321 // abee Scoovo X9H #define BOARD_GT2560_REV_A 74 // Geeetech GT2560 Rev. A #define BOARD_GT2560_REV_A_PLUS 75 // Geeetech GT2560 Rev. A+ (with auto level probe) +#define BOARD_EINSTART_S 666 // Einstart retrofit // // ATmega1281, ATmega2561 @@ -197,7 +199,8 @@ #define BOARD_RAMPS4DUE_EFF 1545 // RAMPS4DUE (Power outputs: Hotend, Fan0, Fan1) #define BOARD_RAMPS4DUE_EEF 1546 // RAMPS4DUE (Power outputs: Hotend0, Hotend1, Fan) #define BOARD_RAMPS4DUE_SF 1548 // RAMPS4DUE (Power outputs: Spindle, Controller Fan) -#define BOARD_RURAMPS4D 1550 // RuRAMPS4Duo v1 (Power outputs: Hotend0, Hotend2, Hotend2, Fan0, Fan1, Bed) +#define BOARD_RURAMPS4D_11 1550 // RuRAMPS4Duo v1.1 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) +#define BOARD_RURAMPS4D_13 1551 // RuRAMPS4Duo v1.3 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) #define BOARD_ULTRATRONICS_PRO 1560 // ReprapWorld Ultratronics Pro V1.0 #define BOARD_ARCHIM2 1590 // UltiMachine Archim2 (with TMC2130 drivers) #define BOARD_ALLIGATOR 1602 // Alligator Board R2 diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h new file mode 100644 index 0000000000..cd2103baca --- /dev/null +++ b/Marlin/src/core/drivers.h @@ -0,0 +1,69 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../inc/MarlinConfigPre.h" + +#define A4988 0x001 +#define DRV8825 0x002 +#define LV8729 0x003 +#define L6470 0x104 +#define TB6560 0x005 +#define TB6600 0x006 +#define TMC2100 0x007 +#define TMC2130 0x108 +#define TMC2130_STANDALONE 0x008 +#define TMC2208 0x109 +#define TMC2208_STANDALONE 0x009 +#define TMC26X 0x10A +#define TMC26X_STANDALONE 0x00A +#define TMC2660 0x10B +#define TMC2660_STANDALONE 0x00B + +#define AXIS_DRIVER_TYPE(A,T) ( defined(A##_DRIVER_TYPE) && (A##_DRIVER_TYPE == T) ) + +#define AXIS_DRIVER_TYPE_X(T) AXIS_DRIVER_TYPE(X,T) +#define AXIS_DRIVER_TYPE_Y(T) AXIS_DRIVER_TYPE(Y,T) +#define AXIS_DRIVER_TYPE_Z(T) AXIS_DRIVER_TYPE(Z,T) +#define AXIS_DRIVER_TYPE_X2(T) (ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE)) && AXIS_DRIVER_TYPE(X2,T) +#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && AXIS_DRIVER_TYPE(Y2,T)) +#define AXIS_DRIVER_TYPE_Z2(T) (ENABLED(Z_DUAL_STEPPER_DRIVERS) && AXIS_DRIVER_TYPE(Z2,T)) +#define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && AXIS_DRIVER_TYPE(E0,T)) +#define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && AXIS_DRIVER_TYPE(E1,T)) +#define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && AXIS_DRIVER_TYPE(E2,T)) +#define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && AXIS_DRIVER_TYPE(E3,T)) +#define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && AXIS_DRIVER_TYPE(E4,T)) + +#define HAS_DRIVER(T) (AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) || \ + AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) || \ + AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) || \ + AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) || \ + AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) || \ + AXIS_DRIVER_TYPE_E4(T) ) + +// Test for supported TMC drivers that require advanced configuration +// Does not match standalone configurations +#define HAS_TRINAMIC ( HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2660) ) + +#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE_##A(TMC2130) || \ + AXIS_DRIVER_TYPE_##A(TMC2208) || \ + AXIS_DRIVER_TYPE_##A(TMC2660) ) diff --git a/Marlin/src/core/enum.h b/Marlin/src/core/enum.h index b9581bec89..d9a3cd18c2 100644 --- a/Marlin/src/core/enum.h +++ b/Marlin/src/core/enum.h @@ -45,8 +45,8 @@ enum AxisEnum : unsigned char { NO_AXIS = 0xFF }; -#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=S; VAR<=N; VAR++) -#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=S; VAR0)-(a<0)) #define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) @@ -200,8 +200,8 @@ #define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) -#define MMM_TO_MMS(MM_M) ((MM_M)/60.0) -#define MMS_TO_MMM(MM_S) ((MM_S)*60.0) +#define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) +#define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) #define NOOP do{} while(0) @@ -250,23 +250,24 @@ #define MAX4(a, b, c, d) MAX(MAX3(a, b, c), d) #define MAX5(a, b, c, d, e) MAX(MAX4(a, b, c, d), e) -#define UNEAR_ZERO(x) ((x) < 0.000001) -#define NEAR_ZERO(x) WITHIN(x, -0.000001, 0.000001) +#define UNEAR_ZERO(x) ((x) < 0.000001f) +#define NEAR_ZERO(x) WITHIN(x, -0.000001f, 0.000001f) #define NEAR(x,y) NEAR_ZERO((x)-(y)) -#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0.0 : 1.0 / (x)) -#define FIXFLOAT(f) (f + (f < 0.0 ? -0.00005 : 0.00005)) +#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0 : (1 / float(x))) +#define FIXFLOAT(f) (f + (f < 0 ? -0.00005f : 0.00005f)) // // Maths macros that can be overridden by HAL // -#define ATAN2(y, x) atan2(y, x) -#define POW(x, y) pow(x, y) -#define SQRT(x) sqrt(x) -#define CEIL(x) ceil(x) -#define FLOOR(x) floor(x) -#define LROUND(x) lround(x) -#define FMOD(x, y) fmod(x, y) +#define ATAN2(y, x) atan2f(y, x) +#define POW(x, y) powf(x, y) +#define SQRT(x) sqrtf(x) +#define RSQRT(x) (1 / sqrtf(x)) +#define CEIL(x) ceilf(x) +#define FLOOR(x) floorf(x) +#define LROUND(x) lroundf(x) +#define FMOD(x, y) fmodf(x, y) #define HYPOT(x,y) SQRT(HYPOT2(x,y)) -#endif //__MACROS_H +#endif // _CORE_MACROS_H_ diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 2c0dabb522..d53d730c6e 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -61,6 +61,8 @@ void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (c #if ENABLED(DEBUG_LEVELING_FEATURE) + #include "enum.h" + void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) { serialprintPGM(prefix); SERIAL_CHAR('('); diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 1b29cfc06a..bbabdb70e3 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -23,7 +23,8 @@ #ifndef __SERIAL_H__ #define __SERIAL_H__ -#include "../inc/MarlinConfig.h" +#include "../inc/MarlinConfigPre.h" +#include HAL_PATH(../HAL, HAL.h) /** * Define debug bit-masks diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 4f0477884f..f4f2e7cf80 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -87,14 +87,14 @@ void safe_delay(millis_t ms); char* ftostr62rj(const float &x); // Convert float to rj string with 123 or -12 format - FORCE_INLINE char* ftostr3(const float &x) { return itostr3(int(x + (x < 0 ? -0.5 : 0.5))); } + FORCE_INLINE char* ftostr3(const float &x) { return itostr3(int(x + (x < 0 ? -0.5f : 0.5f))); } #if ENABLED(LCD_DECIMAL_SMALL_XY) // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format char* ftostr4sign(const float &fx); #else // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format - FORCE_INLINE char* ftostr4sign(const float &x) { return itostr4sign(int(x + (x < 0 ? -0.5 : 0.5))); } + FORCE_INLINE char* ftostr4sign(const float &x) { return itostr4sign(int(x + (x < 0 ? -0.5f : 0.5f))); } #endif #endif // ULTRA_LCD diff --git a/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin/src/feature/I2CPositionEncoder.cpp index 32a598810c..d817f1400c 100644 --- a/Marlin/src/feature/I2CPositionEncoder.cpp +++ b/Marlin/src/feature/I2CPositionEncoder.cpp @@ -181,7 +181,7 @@ void I2CPositionEncoder::update() { if (errPrstIdx >= I2CPE_ERR_PRST_ARRAY_SIZE) { float sumP = 0; LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i]; - const int32_t errorP = int32_t(sumP * (1.0 / (I2CPE_ERR_PRST_ARRAY_SIZE))); + const int32_t errorP = int32_t(sumP * (1.0f / (I2CPE_ERR_PRST_ARRAY_SIZE))); SERIAL_ECHO(axis_codes[encoderAxis]); SERIAL_ECHOPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis]); SERIAL_ECHOLNPGM("mm; correcting!"); diff --git a/Marlin/src/feature/I2CPositionEncoder.h b/Marlin/src/feature/I2CPositionEncoder.h index 4ed5c78836..224e0da8b2 100644 --- a/Marlin/src/feature/I2CPositionEncoder.h +++ b/Marlin/src/feature/I2CPositionEncoder.h @@ -133,16 +133,12 @@ class I2CPositionEncoder { nextErrorCountTime = 0, lastErrorTime; - //double positionMm; //calculate - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) uint8_t errIdx = 0, errPrstIdx = 0; int err[I2CPE_ERR_ARRAY_SIZE] = { 0 }, errPrst[I2CPE_ERR_PRST_ARRAY_SIZE] = { 0 }; #endif - //float positionMm; //calculate - public: void init(const uint8_t address, const AxisEnum axis); void reset(); diff --git a/Marlin/src/feature/Max7219_Debug_LEDs.cpp b/Marlin/src/feature/Max7219_Debug_LEDs.cpp index 1291aebdc8..d9e7a89643 100644 --- a/Marlin/src/feature/Max7219_Debug_LEDs.cpp +++ b/Marlin/src/feature/Max7219_Debug_LEDs.cpp @@ -48,39 +48,11 @@ #include "../Marlin.h" #include "../HAL/Delay.h" -static uint8_t LEDs[8] = { 0 }; +uint8_t LEDs[8 * (MAX7219_NUMBER_UNITS)] = { 0 }; #ifndef MAX7219_ROTATE #define MAX7219_ROTATE 0 #endif -#define _ROT ((MAX7219_ROTATE + 360) % 360) -#if _ROT == 0 - #define _ROW_ y - #define _COL_ x - #define XOR_7219(x, y) LEDs[y] ^= _BV(7 - x) - #define BIT_7219(x, y) TEST(LEDs[y], 7 - x) - #define SEND_7219(R,V) Max7219(max7219_reg_digit0 + R, V) -#elif _ROT == 90 - #define _ROW_ x - #define _COL_ y - #define XOR_7219(x, y) LEDs[x] ^= _BV(y) - #define BIT_7219(x, y) TEST(LEDs[x], y) - #define SEND_7219(R,V) Max7219(max7219_reg_digit0 + R, V) -#elif _ROT == 180 - #define _ROW_ y - #define _COL_ x - #define XOR_7219(x, y) LEDs[y] ^= _BV(x) - #define BIT_7219(x, y) TEST(LEDs[y], x) - #define SEND_7219(R,V) Max7219(max7219_reg_digit7 - R, V) -#elif _ROT == 270 - #define _ROW_ x - #define _COL_ y - #define XOR_7219(x, y) LEDs[x] ^= _BV(7 - y) - #define BIT_7219(x, y) TEST(LEDs[x], 7 - y) - #define SEND_7219(R,V) Max7219(max7219_reg_digit7 - R, V) -#else - #error "MAX7219_ROTATE must be a multiple of +/- 90°." -#endif #ifdef CPU_32_BIT // Approximate a 1µs delay on 32-bit ARM @@ -108,25 +80,24 @@ void Max7219_PutByte(uint8_t data) { CRITICAL_SECTION_END; #endif } +void Max7219_pulse_load() { + SIG_DELAY(); + WRITE(MAX7219_LOAD_PIN, LOW); // tell the chip to load the data + SIG_DELAY(); + WRITE(MAX7219_LOAD_PIN, HIGH); + SIG_DELAY(); +} void Max7219(const uint8_t reg, const uint8_t data) { SIG_DELAY(); #ifndef CPU_32_BIT CRITICAL_SECTION_START; #endif - WRITE(MAX7219_LOAD_PIN, LOW); // begin SIG_DELAY(); Max7219_PutByte(reg); // specify register SIG_DELAY(); Max7219_PutByte(data); // put data - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, LOW); // and tell the chip to load the data - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, HIGH); - #ifndef CPU_32_BIT CRITICAL_SECTION_END; - #endif - SIG_DELAY(); } #if ENABLED(MAX7219_NUMERIC) @@ -145,6 +116,7 @@ void Max7219(const uint8_t reg, const uint8_t data) { max7219_reg_digit0 + start + size, minus ? led_minus : blank ? 0x00 : led_numeral[value % 10] | (dec ? led_decimal : 0x00) ); + Max7219_pulse_load(); // tell the chips to load the clocked out data value /= 10; if (!value && !leadzero) blank = true; dec = false; @@ -176,121 +148,213 @@ inline void Max7219_Error(const char * const func, const int32_t v1, const int32 #endif } -inline uint8_t flipped(const uint8_t bits) { - uint8_t outbits = 0; - for (uint8_t b = 0; b < 8; b++) - if (bits & _BV(b)) outbits |= _BV(7 - b); +/** + * uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) operates on the number + * of bytes specified in n_bytes. The lower order bits of the supplied bits are flipped. + * flipped( x, 1) flips the low 8 bits of x. + * flipped( x, 2) flips the low 16 bits of x. + * flipped( x, 3) flips the low 24 bits of x. + * flipped( x, 4) flips the low 32 bits of x. + */ + +inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) { + uint32_t mask = 1, outbits = 0; + for (uint8_t b = 0; b < n_bytes * 8; b++) { + outbits = (outbits << 1); + if (bits & mask) + outbits |= 1; + mask <<= 1; + } return outbits; } // Modify a single LED bit and send the changed line void Max7219_LED_Set(const uint8_t x, const uint8_t y, const bool on) { - if (x > 7 || y > 7) return Max7219_Error(PSTR("Max7219_LED_Set"), x, y); + if (x > (MAX7219_X_LEDS - 1) || y > (MAX7219_Y_LEDS - 1)) return Max7219_Error(PSTR("Max7219_LED_Set"), x, y); if (BIT_7219(x, y) == on) return; XOR_7219(x, y); - SEND_7219(_ROW_, LEDs[_ROW_]); + SEND_7219(MAX7219_UPDATE_AXIS); } void Max7219_LED_On(const uint8_t x, const uint8_t y) { - if (x > 7 || y > 7) return Max7219_Error(PSTR("Max7219_LED_On"), x, y); + if (x > (MAX7219_X_LEDS - 1) || y > (MAX7219_Y_LEDS - 1)) return Max7219_Error(PSTR("Max7219_LED_On"), x, y); Max7219_LED_Set(x, y, true); } void Max7219_LED_Off(const uint8_t x, const uint8_t y) { - if (x > 7 || y > 7) return Max7219_Error(PSTR("Max7219_LED_Off"), x, y); + if (x > (MAX7219_X_LEDS - 1) || y > (MAX7219_Y_LEDS - 1)) return Max7219_Error(PSTR("Max7219_LED_Off"), x, y); Max7219_LED_Set(x, y, false); } void Max7219_LED_Toggle(const uint8_t x, const uint8_t y) { - if (x > 7 || y > 7) return Max7219_Error(PSTR("Max7219_LED_Toggle"), x, y); + if (x > (MAX7219_X_LEDS - 1) || y > (MAX7219_Y_LEDS - 1)) return Max7219_Error(PSTR("Max7219_LED_Toggle"), x, y); Max7219_LED_Set(x, y, !BIT_7219(x, y)); } -inline void _Max7219_Set_Reg(const uint8_t reg, const uint8_t val) { - LEDs[reg] = val; - SEND_7219(reg, val); +inline void _Max7219_Set_Digit_Segments(const uint8_t digit, const uint8_t val) { + LEDs[digit] = val; + SEND_7219(digit); } -void Max7219_Set_Row(const uint8_t _ROW_, const uint8_t val) { - if (_ROW_ > 7) return Max7219_Error(PSTR("Max7219_Set_Row"), _ROW_); - #if _ROT == 90 - for (uint8_t _COL_ = 0; _COL_ <= 7; _COL_++) Max7219_LED_Set(7 - _COL_, _ROW_, TEST(val, _COL_)); - #elif _ROT == 180 - _Max7219_Set_Reg(_ROW_, flipped(val)); - #elif _ROT == 270 - for (uint8_t _COL_ = 0; _COL_ <= 7; _COL_++) Max7219_LED_Set(_COL_, _ROW_, TEST(val, _COL_)); +/** + * void Max7219_Set_Row( const uint8_t col, const uint32_t val) plots the low order bits of + * val to the specified row of the Max7219 matrix. With 4 Max7219 units in the chain, it + * is possible to display an entire 32-bit number with one call to the function (if appropriately + * orientated). + */ +void Max7219_Set_Row(const uint8_t row, const uint32_t val) { + if (row >= MAX7219_Y_LEDS) return Max7219_Error(PSTR("Max7219_Set_Row"), row); + uint32_t mask = 0x0000001; + for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) { + if (val & mask) + SET_PIXEL_7219((MAX7219_X_LEDS-1-x), row); + else + CLEAR_PIXEL_7219((MAX7219_X_LEDS-1-x), row); + mask <<= 1; + } + + #if _ROT == 90 || _ROT == 270 + for (uint8_t x = 0; x < 8; x++) + SEND_7219(x); // force all columns out to the Max7219 chips and strobe them #else - _Max7219_Set_Reg(_ROW_, val); + SEND_7219(row); // force the single column out to the Max7219 chips and strobe them #endif } -void Max7219_Clear_Row(const uint8_t _ROW_) { - if (_ROW_ > 7) return Max7219_Error(PSTR("Max7219_Clear_Row"), _ROW_); +void Max7219_Clear_Row(const uint8_t row) { + if (row > 7) return Max7219_Error(PSTR("Max7219_Clear_Row"), row); #if _ROT == 90 || _ROT == 270 - for (uint8_t _COL_ = 0; _COL_ <= 7; _COL_++) Max7219_LED_Off(_COL_, _ROW_); + for (uint8_t col = 0; col < 8; col++) Max7219_LED_Off(col, row); #else - _Max7219_Set_Reg(_ROW_, 0); + _Max7219_Set_Digit_Segments(row, 0); #endif } -void Max7219_Set_Column(const uint8_t _COL_, const uint8_t val) { - if (_COL_ > 7) return Max7219_Error(PSTR("Max7219_Set_Column"), _COL_); - #if _ROT == 90 - _Max7219_Set_Reg(_COL_, val); - #elif _ROT == 180 - for (uint8_t _ROW_ = 0; _ROW_ <= 7; _ROW_++) Max7219_LED_Set(_COL_, _ROW_, TEST(val, _ROW_)); - #elif _ROT == 270 - _Max7219_Set_Reg(_COL_, flipped(val)); +/** + * void Max7219_Set_Column( const uint8_t col, const uint32_t val) plots the low order bits of + * val to the specified column of the Max7219 matrix. With 4 Max7219 units in the chain, it + * is possible to display an entire 32-bit number with one call to the function (if appropriately + * orientated). + */ +void Max7219_Set_Column(const uint8_t col, const uint32_t val) { + if (col >= MAX7219_X_LEDS) return Max7219_Error(PSTR("Max7219_Set_Column"), col); + uint32_t mask = 0x0000001; + for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) { + if (val & mask) + SET_PIXEL_7219(col, MAX7219_Y_LEDS-1-y); + else + CLEAR_PIXEL_7219(col, MAX7219_Y_LEDS-1-y); + mask <<= 1; + } + #if _ROT == 90 || _ROT == 270 + SEND_7219(col); // force the column out to the Max7219 chips and strobe them #else - for (uint8_t _ROW_ = 0; _ROW_ <= 7; _ROW_++) Max7219_LED_Set(_COL_, _ROW_, TEST(val, _ROW_)); + for (uint8_t yy = 0; yy < 8; yy++) + SEND_7219(yy); // force all columns out to the Max7219 chips and strobe them #endif } -void Max7219_Clear_Column(const uint8_t _COL_) { - if (_COL_ > 7) return Max7219_Error(PSTR("Max7219_Clear_Column"), _COL_); +void Max7219_Clear_Column(const uint8_t col) { + if (col >= MAX7219_X_LEDS) return Max7219_Error(PSTR("Max7219_Clear_Column"), col); + + for (uint8_t yy = 0; yy < MAX7219_Y_LEDS; yy++) + CLEAR_PIXEL_7219(col, yy); + #if _ROT == 90 || _ROT == 270 - _Max7219_Set_Reg(_COL_, 0); + SEND_7219(col); // force the column out to the Max7219 chips and strobe them #else - for (uint8_t _ROW_ = 0; _ROW_ <= 7; _ROW_++) Max7219_LED_Off(_COL_, _ROW_); + for (uint8_t y = 0; y < 8; y++) + SEND_7219(y); // force all columns out to the Max7219 chips and strobe them #endif } -void Max7219_Set_2_Rows(const uint8_t y, uint16_t val) { - if (y > 6) return Max7219_Error(PSTR("Max7219_Set_2_Rows"), y, val); - Max7219_Set_Row(y + 0, val & 0xFF); val >>= 8; - Max7219_Set_Row(y + 1, val & 0xFF); +void Max7219_Clear() { + for (uint8_t i = 0; i <= 7; i++) { // Clear LED bitmap + for (uint8_t j = 0; j < MAX7219_NUMBER_UNITS; j++) + LEDs[i + j * 8] = 0x00; + SEND_7219(i); + } + +} + +void Max7219_Set_Rows_16bits(const uint8_t y, uint32_t val) { + #if MAX7219_X_LEDS == 8 + if (y > MAX7219_Y_LEDS - 2) return Max7219_Error(PSTR("Max7219_Set_Rows_16bits"), y, val); + Max7219_Set_Row(y + 1, val); val >>= 8; + Max7219_Set_Row(y + 0, val); + #else // at least 16 bits on each row + if (y > MAX7219_Y_LEDS - 1) return Max7219_Error(PSTR("Max7219_Set_Rows_16bits"), y, val); + Max7219_Set_Row(y, val); + #endif } -void Max7219_Set_4_Rows(const uint8_t y, uint32_t val) { - if (y > 4) return Max7219_Error(PSTR("Max7219_Set_4_Rows"), y, val); - Max7219_Set_Row(y + 0, val & 0xFF); val >>= 8; - Max7219_Set_Row(y + 1, val & 0xFF); val >>= 8; - Max7219_Set_Row(y + 2, val & 0xFF); val >>= 8; - Max7219_Set_Row(y + 3, val & 0xFF); +void Max7219_Set_Rows_32bits(const uint8_t y, uint32_t val) { + #if MAX7219_X_LEDS == 8 + if (y > MAX7219_Y_LEDS - 4) return Max7219_Error(PSTR("Max7219_Set_Rows_32bits"), y, val); + Max7219_Set_Row(y + 3, val); val >>= 8; + Max7219_Set_Row(y + 2, val); val >>= 8; + Max7219_Set_Row(y + 1, val); val >>= 8; + Max7219_Set_Row(y + 0, val); + #elif MAX7219_X_LEDS == 16 + if (y > MAX7219_Y_LEDS - 2) return Max7219_Error(PSTR("Max7219_Set_Rows_32bits"), y, val); + Max7219_Set_Row(y + 1, val); val >>= 16; + Max7219_Set_Row(y + 0, val); + #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits + if (y > MAX7219_Y_LEDS - 1) return Max7219_Error(PSTR("Max7219_Set_Rows_32bits"), y, val); + Max7219_Set_Row(y, val); + #endif } -void Max7219_Set_2_Columns(const uint8_t x, uint16_t val) { - if (x > 6) return Max7219_Error(PSTR("Max7219_Set_2_Columns"), x, val); - Max7219_Set_Column(x + 0, val & 0xFF); val >>= 8; - Max7219_Set_Column(x + 1, val & 0xFF); +void Max7219_Set_Columns_16bits(const uint8_t x, uint32_t val) { + #if MAX7219_Y_LEDS == 8 + if (x > MAX7219_X_LEDS - 2) return Max7219_Error(PSTR("Max7219_Set_Columns_16bits"), x, val); + Max7219_Set_Column(x + 0, val); val >>= 8; + Max7219_Set_Column(x + 1, val); + #else // at least 16 bits in each column + if (x > MAX7219_X_LEDS - 1) return Max7219_Error(PSTR("Max7219_Set_Columns_16bits"), x, val); + Max7219_Set_Column(x, val); + #endif } -void Max7219_Set_4_Columns(const uint8_t x, uint32_t val) { - if (x > 4) return Max7219_Error(PSTR("Max7219_Set_4_Columns"), x, val); - Max7219_Set_Column(x + 0, val & 0xFF); val >>= 8; - Max7219_Set_Column(x + 1, val & 0xFF); val >>= 8; - Max7219_Set_Column(x + 2, val & 0xFF); val >>= 8; - Max7219_Set_Column(x + 3, val & 0xFF); +void Max7219_Set_Columns_32bits(const uint8_t x, uint32_t val) { + #if MAX7219_Y_LEDS == 8 + if (x > MAX7219_X_LEDS - 4) return Max7219_Error(PSTR("Max7219_Set_Rows_32bits"), x, val); + Max7219_Set_Column(x + 3, val); val >>= 8; + Max7219_Set_Column(x + 2, val); val >>= 8; + Max7219_Set_Column(x + 1, val); val >>= 8; + Max7219_Set_Column(x + 0, val); + #elif MAX7219_Y_LEDS == 16 + if (x > MAX7219_X_LEDS - 2) return Max7219_Error(PSTR("Max7219_Set_Rows_32bits"), x, val); + Max7219_Set_Column(x + 1, val); val >>= 16; + Max7219_Set_Column(x + 0, val); + #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits + if (x > MAX7219_X_LEDS - 1) return Max7219_Error(PSTR("Max7219_Set_Rows_32bits"), x, val); + Max7219_Set_Column(x, val); + #endif } void Max7219_register_setup() { // Initialize the Max7219 - Max7219(max7219_reg_scanLimit, 0x07); - Max7219(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits) - Max7219(max7219_reg_shutdown, 0x01); // not in shutdown mode - Max7219(max7219_reg_displayTest, 0x00); // no display test - Max7219(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set + for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) + Max7219(max7219_reg_scanLimit, 0x07); + Max7219_pulse_load(); // tell the chips to load the clocked out data + + for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) + Max7219(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits) + Max7219_pulse_load(); // tell the chips to load the clocked out data + + for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) + Max7219(max7219_reg_shutdown, 0x01); // not in shutdown mode + Max7219_pulse_load(); // tell the chips to load the clocked out data + + for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) + Max7219(max7219_reg_displayTest, 0x00); // no display test + Max7219_pulse_load(); // tell the chips to load the clocked out data + + for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) + Max7219(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set // range: 0x00 to 0x0F + Max7219_pulse_load(); // tell the chips to load the clocked out data } #ifdef MAX7219_INIT_TEST @@ -299,24 +363,21 @@ void Max7219_register_setup() { inline void Max7219_spiral(const bool on, const uint16_t del) { constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 }; int8_t px = 0, py = 0, dir = 0; - for (uint8_t i = 64; i--;) { + for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) { Max7219_LED_Set(px, py, on); delay(del); const int8_t x = px + way[dir], y = py + way[dir + 1]; - if (!WITHIN(x, 0, 7) || !WITHIN(y, 0, 7) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7; + if (!WITHIN(x, 0, MAX7219_X_LEDS-1) || !WITHIN(y, 0, MAX7219_Y_LEDS-1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7; px += way[dir]; py += way[dir + 1]; } } #else - inline void Max7219_colset(const uint8_t x, const bool on) { - for (uint8_t y = 0; y <= 7; y++) Max7219_LED_Set(x, y, on); - } inline void Max7219_sweep(const int8_t dir, const uint16_t ms, const bool on) { - uint8_t x = dir > 0 ? 0 : 7; - for (uint8_t i = 8; i--; x += dir) { - Max7219_Set_Column(x, on ? 0xFF : 0x00); + uint8_t x = dir > 0 ? 0 : MAX7219_X_LEDS-1; + for (uint8_t i = MAX7219_X_LEDS; i--; x += dir) { + Max7219_Set_Column(x, on ? 0xFFFFFFFF : 0x00000000); delay(ms); } } @@ -335,6 +396,7 @@ void Max7219_init() { for (uint8_t i = 0; i <= 7; i++) { // Empty registers to turn all LEDs off LEDs[i] = 0x00; Max7219(max7219_reg_digit0 + i, 0); + Max7219_pulse_load(); // tell the chips to load the clocked out data } #ifdef MAX7219_INIT_TEST @@ -362,22 +424,54 @@ void Max7219_init() { // Apply changes to update a marker inline void Max7219_Mark16(const uint8_t y, const uint8_t v1, const uint8_t v2) { - Max7219_LED_Off(v1 & 0x7, y + (v1 >= 8)); - Max7219_LED_On(v2 & 0x7, y + (v2 >= 8)); + #if MAX7219_X_LEDS == 8 + #if MAX7219_Y_LEDS == 8 + Max7219_LED_Off(v1 & 0x7, y + (v1 >= 8)); + Max7219_LED_On(v2 & 0x7, y + (v2 >= 8)); + #else + Max7219_LED_Off(y, v1 & 0xF); // The Max7219 Y-Axis has at least 16 LED's. So use a single column + Max7219_LED_On(y, v2 & 0xF); + #endif + #else // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's + Max7219_LED_Off(v1 & 0xf, y); + Max7219_LED_On(v2 & 0xf, y); + #endif } // Apply changes to update a tail-to-head range inline void Max7219_Range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh) { - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - Max7219_LED_Off(n & 0x7, y + (n >= 8)); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - Max7219_LED_On(n & 0x7, y + (n >= 8)); + #if MAX7219_X_LEDS == 8 + #if MAX7219_Y_LEDS == 8 + if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) + Max7219_LED_Off(n & 0x7, y + (n >= 8)); + if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) + Max7219_LED_On(n & 0x7, y + (n >= 8)); + #else // The Max7219 Y-Axis has at least 16 LED's. So use a single column + if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) + Max7219_LED_Off(y, n & 0xF); + if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) + Max7219_LED_On(y, n & 0xF); + #endif + #else // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's + if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) + Max7219_LED_Off(n & 0xf, y); + if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) + Max7219_LED_On(n & 0xf, y); + #endif } // Apply changes to update a quantity inline void Max7219_Quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv) { for (uint8_t i = MIN(nv, ov); i < MAX(nv, ov); i++) - Max7219_LED_Set(i >> 1, y + (i & 1), nv >= ov); + #if MAX7219_X_LEDS == 8 + #if MAX7219_Y_LEDS == 8 + Max7219_LED_Set(i >> 1, y + (i & 1), nv >= ov); // single 8x8 LED matrix. Use two lines to get 16 LED's + #else + Max7219_LED_Set(y, i, nv >= ov); // The Max7219 Y-Axis has at least 16 LED's. So use a single column + #endif + #else + Max7219_LED_Set(i, y, nv >= ov); // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's + #endif } void Max7219_idle_tasks() { @@ -420,7 +514,7 @@ void Max7219_idle_tasks() { #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) if (do_blink) { - Max7219_LED_Toggle(7, 7); + Max7219_LED_Toggle(MAX7219_X_LEDS - 1, MAX7219_Y_LEDS - 1); next_blink = ms + 1000; } #endif diff --git a/Marlin/src/feature/Max7219_Debug_LEDs.h b/Marlin/src/feature/Max7219_Debug_LEDs.h index dec159cee9..e550a2906d 100644 --- a/Marlin/src/feature/Max7219_Debug_LEDs.h +++ b/Marlin/src/feature/Max7219_Debug_LEDs.h @@ -33,6 +33,12 @@ * * Max7219_init() is called automatically at startup, and then there are a number of * support functions available to control the LEDs in the 8x8 grid. + * + * If you are using the Max7219 matrix for firmware debug purposes in time sensitive + * areas of the code, please be aware that the orientation (rotation) of the display can + * affect the speed. The Max7219 can update a single column fairly fast. It is much + * faster to do a Max7219_Set_Column() with a rotation of 90 or 270 degrees than to do + * a Max7219_Set_Row(). The opposite is true for rotations of 0 or 180 degrees. */ #ifndef __MAX7219_DEBUG_LEDS_H__ @@ -59,6 +65,7 @@ void Max7219_init(); void Max7219_PutByte(uint8_t data); +void Max7219_pulse_load(); // Set a single register (e.g., a whole native row) void Max7219(const uint8_t reg, const uint8_t data); @@ -69,15 +76,72 @@ void Max7219_LED_On(const uint8_t x, const uint8_t y); void Max7219_LED_Off(const uint8_t x, const uint8_t y); void Max7219_LED_Toggle(const uint8_t x, const uint8_t y); -// Set all 8 LEDs in a single column -void Max7219_Set_Column(const uint8_t col, const uint8_t val); +// Set all LEDs in a single column +void Max7219_Set_Column(const uint8_t col, const uint32_t val); void Max7219_Clear_Column(const uint8_t col); -// Set all 8 LEDs in a single row -void Max7219_Set_Row(const uint8_t row, const uint8_t val); +// Set all LEDs in a single row +void Max7219_Set_Row(const uint8_t row, const uint32_t val); void Max7219_Clear_Row(const uint8_t row); +// 16 and 32 bit versions of Row and Column functions +// Multiple rows and columns will be used to display the value if +// the array of matrix LED's is too narrow to accomplish the goal +void Max7219_Set_Rows_16bits(const uint8_t y, uint32_t val); +void Max7219_Set_Rows_32bits(const uint8_t y, uint32_t val); +void Max7219_Set_Columns_16bits(const uint8_t x, uint32_t val); +void Max7219_Set_Columns_32bits(const uint8_t x, uint32_t val); + +// Quickly clear the whole matrix +void Max7219_Clear(); + // Apply custom code to update the matrix void Max7219_idle_tasks(); +#ifndef MAX7219_ROTATE + #define MAX7219_ROTATE 0 +#endif +#define _ROT ((MAX7219_ROTATE + 360) % 360) +#if _ROT == 0 + #define MAX7219_UPDATE_AXIS y // Fast line update axis for this orientation of the matrix display + #define MAX7219_Y_LEDS 8 + #define MAX7219_X_LEDS (MAX7219_Y_LEDS * (MAX7219_NUMBER_UNITS)) + #define XOR_7219(x, y) LEDs[(x & 0xF8) + y] ^= _BV(7 - (x & 0x07)) + #define SET_PIXEL_7219(x, y) LEDs[(x & 0xF8) + y] |= _BV(7 - (x & 0x07)) + #define CLEAR_PIXEL_7219(x, y) LEDs[(x & 0xF8) + y] &= (_BV(7 - (x & 0x07)) ^ 0xFF) + #define BIT_7219(x, y) TEST(LEDs[(x & 0xF8) + y], 7 - (x & 0x07)) + #define SEND_7219(R) do {for(int8_t jj = 0; jj < MAX7219_NUMBER_UNITS; jj++) Max7219(max7219_reg_digit0 + (R & 0x7), LEDs[(R & 0x7) + jj * 8]); Max7219_pulse_load(); } while (0); +#elif _ROT == 90 + #define MAX7219_UPDATE_AXIS x // Fast line update axis for this orientation of the matrix display + #define MAX7219_X_LEDS 8 + #define MAX7219_Y_LEDS (MAX7219_X_LEDS * (MAX7219_NUMBER_UNITS)) + #define XOR_7219(x, y) LEDs[x + ((MAX7219_Y_LEDS - 1 - y) & 0xF8)] ^= _BV((y & 0x7)) + #define SET_PIXEL_7219(x, y) LEDs[x + ((MAX7219_Y_LEDS - 1 - y) & 0xF8)] |= _BV((y & 0x7)) + #define CLEAR_PIXEL_7219(x, y) LEDs[x + ((MAX7219_Y_LEDS - 1 - y) & 0xF8)] &= (_BV((y & 0x7)) ^ 0xFF) + #define BIT_7219(x, y) TEST(LEDs[x + ((MAX7219_Y_LEDS - 1 - y) & 0xF8)], (y & 0x7)) + #define SEND_7219(R) do {for(int8_t jj = 0; jj < MAX7219_NUMBER_UNITS; jj++) Max7219(max7219_reg_digit0 + (R & 0x7), LEDs[(R & 0x7) + jj * 8]); Max7219_pulse_load(); } while (0); +#elif _ROT == 180 + #define MAX7219_UPDATE_AXIS y // Fast line update axis for this orientation of the matrix display + #define MAX7219_Y_LEDS 8 + #define MAX7219_X_LEDS (MAX7219_Y_LEDS * (MAX7219_NUMBER_UNITS)) + #define XOR_7219(x, y) LEDs[y + (MAX7219_X_LEDS - 1 - (x)) & 0xF8] ^= _BV((x & 0x07)) + #define SET_PIXEL_7219(x, y) LEDs[y + (MAX7219_X_LEDS - 1 - (x)) & 0xF8] |= _BV((x & 0x07)) + #define CLEAR_PIXEL_7219(x, y) LEDs[y + (MAX7219_X_LEDS - 1 - (x)) & 0xF8] &= (_BV((x & 0x07)) ^ 0xFF) + #define BIT_7219(x, y) TEST(LEDs[y + (MAX7219_X_LEDS - 1 - (x)) & 0xF8], ((x & 0x07))) + #define SEND_7219(R) do {for(int8_t jj = 0; jj < MAX7219_NUMBER_UNITS; jj++) Max7219(max7219_reg_digit7 - (R & 0x7), LEDs[(R & 0x7) + jj * 8]); Max7219_pulse_load(); } while (0); +#elif _ROT == 270 + #define MAX7219_UPDATE_AXIS x // Fast line update axis for this orientation of the matrix display + #define MAX7219_X_LEDS 8 + #define MAX7219_Y_LEDS (MAX7219_X_LEDS * (MAX7219_NUMBER_UNITS)) + #define XOR_7219(x, y) LEDs[x + (y & 0xF8)] ^= _BV(7 - (y & 0x7)) + #define SET_PIXEL_7219(x, y) LEDs[x + (y & 0xF8)] |= _BV(7 - (y & 0x7)) + #define CLEAR_PIXEL_7219(x, y) LEDs[x + (y & 0xF8)] &= (_BV(7 - (y & 0x7)) ^ 0xFF) + #define BIT_7219(x, y) TEST(LEDs[x + (y & 0xF8)], 7 - (y & 0x7)) + #define SEND_7219(R) do {for(int8_t jj = 0; jj < MAX7219_NUMBER_UNITS; jj++) Max7219(max7219_reg_digit7 - (R & 0x7), LEDs[(R & 0x7) + jj * 8]); Max7219_pulse_load(); } while (0); +#else + #error "MAX7219_ROTATE must be a multiple of +/- 90°." +#endif + +extern uint8_t LEDs[8*MAX7219_NUMBER_UNITS]; + #endif // __MAX7219_DEBUG_LEDS_H__ diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 797a9dc506..99887d361d 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -266,7 +266,14 @@ void reset_bed_level() { void _manual_goto_xy(const float &rx, const float &ry) { - #if MANUAL_PROBE_HEIGHT > 0 + #ifdef MANUAL_PROBE_START_Z + #if MANUAL_PROBE_HEIGHT > 0 + do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); + do_blocking_move_to_z(MAX(0,MANUAL_PROBE_START_Z)); + #else + do_blocking_move_to(rx, ry, MAX(0,MANUAL_PROBE_START_Z)); + #endif + #elif MANUAL_PROBE_HEIGHT > 0 const float prev_z = current_position[Z_AXIS]; do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); do_blocking_move_to_z(prev_z); diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index 94dadeccf0..5b68edefe5 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -72,22 +72,22 @@ class mesh_bed_leveling { } static int8_t cell_index_x(const float &x) { - int8_t cx = (x - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); + int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2); } static int8_t cell_index_y(const float &y) { - int8_t cy = (y - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); + int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); } static int8_t probe_index_x(const float &x) { - int8_t px = (x - (MESH_MIN_X) + 0.5 * (MESH_X_DIST)) * (1.0 / (MESH_X_DIST)); + int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * (1.0f / (MESH_X_DIST)); return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t probe_index_y(const float &y) { - int8_t py = (y - (MESH_MIN_Y) + 0.5 * (MESH_Y_DIST)) * (1.0 / (MESH_Y_DIST)); + int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * (1.0f / (MESH_Y_DIST)); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index eb88234823..cbd5ed4bf6 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -168,14 +168,14 @@ class unified_bed_leveling { FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } static int8_t get_cell_index_x(const float &x) { - const int8_t cx = (x - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); + const int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably // that is OK because something else should be keeping that from // happening and should not be worried about at this level. static int8_t get_cell_index_y(const float &y) { - const int8_t cy = (y - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); + const int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably @@ -183,12 +183,12 @@ class unified_bed_leveling { // happening and should not be worried about at this level. static int8_t find_closest_x_index(const float &x) { - const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST)); + const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0f / (MESH_X_DIST)); return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t find_closest_y_index(const float &y) { - const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0 / (MESH_Y_DIST)); + const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0f / (MESH_Y_DIST)); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } @@ -238,7 +238,7 @@ class unified_bed_leveling { ); } - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)), + const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0f / (MESH_X_DIST)), z1 = z_values[x1_i][yi]; return z1 + xratio * (z_values[MIN(x1_i, GRID_MAX_POINTS_X - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array @@ -272,7 +272,7 @@ class unified_bed_leveling { ); } - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)), + const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0f / (MESH_Y_DIST)), z1 = z_values[xi][y1_i]; return z1 + yratio * (z_values[xi][MIN(y1_i, GRID_MAX_POINTS_Y - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index c7c0352dfd..654b4c193c 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -41,6 +41,10 @@ #include "../../../feature/bedlevel/bedlevel.h" #include "../../../libs/least_squares_fit.h" + #if ENABLED(DUAL_X_CARRIAGE) + #include "../../../module/tool_change.h" + #endif + #include #define UBL_G29_P31 @@ -65,8 +69,8 @@ unified_bed_leveling::g29_y_flag; float unified_bed_leveling::g29_x_pos, unified_bed_leveling::g29_y_pos, - unified_bed_leveling::g29_card_thickness = 0.0, - unified_bed_leveling::g29_constant = 0.0; + unified_bed_leveling::g29_card_thickness = 0, + unified_bed_leveling::g29_constant = 0; #if HAS_BED_PROBE int unified_bed_leveling::g29_grid_size; @@ -299,10 +303,10 @@ // Check for commands that require the printer to be homed if (may_move) { - if (axis_unhomed_error()) gcode.home_all_axes(); #if ENABLED(DUAL_X_CARRIAGE) if (active_extruder != 0) tool_change(0); #endif + if (axis_unhomed_error()) gcode.home_all_axes(); } // Invalidate Mesh Points. This command is a little bit asymmetrical because @@ -346,23 +350,23 @@ case 0: for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta. - const float p1 = 0.5 * (GRID_MAX_POINTS_X) - x, - p2 = 0.5 * (GRID_MAX_POINTS_Y) - y; - z_values[x][y] += 2.0 * HYPOT(p1, p2); + const float p1 = 0.5f * (GRID_MAX_POINTS_X) - x, + p2 = 0.5f * (GRID_MAX_POINTS_Y) - y; + z_values[x][y] += 2.0f * HYPOT(p1, p2); } } break; case 1: for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised - z_values[x][x] += 9.999; - z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999; // We want the altered line several mesh points thick + z_values[x][x] += 9.999f; + z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick } break; case 2: // Allow the user to specify the height because 10mm is a little extreme in some cases. for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) // the center of the bed - z_values[x][y] += parser.seen('C') ? g29_constant : 9.99; + z_values[x][y] += parser.seen('C') ? g29_constant : 9.99f; break; } } @@ -381,7 +385,7 @@ tilt_mesh_based_on_probed_grid(true /* true says to do 3-Point leveling */ ); restore_ubl_active_state_and_leave(); } - do_blocking_move_to_xy(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y))); + do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y))); report_current_position(); } @@ -453,7 +457,7 @@ if (parser.seen('B')) { g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES); - if (ABS(g29_card_thickness) > 1.5) { + if (ABS(g29_card_thickness) > 1.5f) { SERIAL_PROTOCOLLNPGM("?Error in Business Card measurement."); return; } @@ -509,7 +513,7 @@ } else { const float cvf = parser.value_float(); - switch ((int)truncf(cvf * 10.0) - 30) { // 3.1 -> 1 + switch ((int)truncf(cvf * 10.0f) - 30) { // 3.1 -> 1 #if ENABLED(UBL_G29_P31) case 1: { @@ -519,8 +523,8 @@ // P3.12 100X distance weighting // P3.13 1000X distance weighting, approaches simple average of nearest points - const float weight_power = (cvf - 3.10) * 100.0, // 3.12345 -> 2.345 - weight_factor = weight_power ? POW(10.0, weight_power) : 0; + const float weight_power = (cvf - 3.10f) * 100.0f, // 3.12345 -> 2.345 + weight_factor = weight_power ? POW(10.0f, weight_power) : 0; smart_fill_wlsf(weight_factor); } break; @@ -634,7 +638,7 @@ } void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float value) { - float sum = 0.0; + float sum = 0; int n = 0; for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) @@ -648,7 +652,7 @@ // // Sum the squares of difference from mean // - float sum_of_diff_squared = 0.0; + float sum_of_diff_squared = 0; for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(z_values[x][y])) @@ -786,7 +790,7 @@ float unified_bed_leveling::measure_point_with_encoder() { KEEPALIVE_STATE(PAUSED_FOR_USER); - move_z_with_encoder(0.01); + move_z_with_encoder(0.01f); KEEPALIVE_STATE(IN_HANDLER); return current_position[Z_AXIS]; } @@ -797,8 +801,8 @@ lcd_external_control = true; save_ubl_active_state_and_disable(); // Disable bed level correction for probing - do_blocking_move_to(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); - //, MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0); + do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); + //, MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) * 0.5f); planner.synchronize(); SERIAL_PROTOCOLPGM("Place shim under nozzle"); @@ -874,8 +878,8 @@ serialprintPGM(parser.seen('B') ? PSTR(MSG_UBL_BC_INSERT) : PSTR(MSG_UBL_BC_INSERT2)); - const float z_step = 0.01; // existing behavior: 0.01mm per click, occasionally step - //const float z_step = 1.0 / planner.axis_steps_per_mm[Z_AXIS]; // approx one step each click + const float z_step = 0.01f; // existing behavior: 0.01mm per click, occasionally step + //const float z_step = planner.steps_to_mm[Z_AXIS]; // approx one step each click move_z_with_encoder(z_step); @@ -913,7 +917,7 @@ lcd_quick_feedback(true); #endif - g29_constant = 0.0; + g29_constant = 0; g29_repetition_cnt = 0; g29_x_flag = parser.seenval('X'); @@ -1004,7 +1008,7 @@ #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) if (parser.seenval('F')) { const float fh = parser.value_float(); - if (!WITHIN(fh, 0.0, 100.0)) { + if (!WITHIN(fh, 0, 100)) { SERIAL_PROTOCOLLNPGM("?(F)ade height for Bed Level Correction not plausible.\n"); return UBL_ERR; } @@ -1226,7 +1230,7 @@ mesh_index_pair out_mesh; out_mesh.x_index = out_mesh.y_index = -1; - out_mesh.distance = -99999.99; + out_mesh.distance = -99999.99f; for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { @@ -1242,7 +1246,7 @@ found_a_NAN = true; int8_t closest_x = -1, closest_y = -1; - float d1, d2 = 99999.9; + float d1, d2 = 99999.9f; for (int8_t k = 0; k < GRID_MAX_POINTS_X; k++) { for (int8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { if (!isnan(z_values[k][l])) { @@ -1252,7 +1256,7 @@ // last half of the mesh (when every unprobed mesh point is one index // from a probed location). - d1 = HYPOT(i - k, j - l) + (1.0 / ((millis() % 47) + 13)); + d1 = HYPOT(i - k, j - l) + (1.0f / ((millis() % 47) + 13)); if (d1 < d2) { // found a closer distance from invalid mesh point at (i,j) to defined mesh point at (k,l) d2 = d1; // found a closer location with @@ -1279,7 +1283,7 @@ if (!found_a_real && found_a_NAN) { // if the mesh is totally unpopulated, start the probing out_mesh.x_index = GRID_MAX_POINTS_X / 2; out_mesh.y_index = GRID_MAX_POINTS_Y / 2; - out_mesh.distance = 1.0; + out_mesh.distance = 1; } return out_mesh; } @@ -1287,13 +1291,13 @@ mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const float &rx, const float &ry, const bool probe_as_reference, uint16_t bits[16]) { mesh_index_pair out_mesh; out_mesh.x_index = out_mesh.y_index = -1; - out_mesh.distance = -99999.9; + out_mesh.distance = -99999.9f; // Get our reference position. Either the nozzle or probe location. const float px = rx - (probe_as_reference == USE_PROBE_AS_REFERENCE ? X_PROBE_OFFSET_FROM_EXTRUDER : 0), py = ry - (probe_as_reference == USE_PROBE_AS_REFERENCE ? Y_PROBE_OFFSET_FROM_EXTRUDER : 0); - float best_so_far = 99999.99; + float best_so_far = 99999.99f; for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { @@ -1320,7 +1324,7 @@ // factor in the distance from the current location for the normal case // so the nozzle isn't running all over the bed. - distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1; + distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1f; if (distance < best_so_far) { best_so_far = distance; // We found a closer location with out_mesh.x_index = i; // the specified type of mesh value. @@ -1401,8 +1405,8 @@ lcd_refresh(); float new_z = z_values[location.x_index][location.y_index]; - if (isnan(new_z)) new_z = 0.0; // Invalid points begin at 0 - new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place + if (isnan(new_z)) new_z = 0; // Invalid points begin at 0 + new_z = FLOOR(new_z * 1000) * 0.001f; // Chop off digits after the 1000ths place lcd_mesh_edit_setup(new_z); @@ -1461,7 +1465,7 @@ if (z_values[x1][y1] < z_values[x2][y2]) // Angled downward? z_values[x][y] = z_values[x1][y1]; // Use nearest (maybe a little too high.) else - z_values[x][y] = 2.0 * z_values[x1][y1] - z_values[x2][y2]; // Angled upward... + z_values[x][y] = 2.0f * z_values[x1][y1] - z_values[x2][y2]; // Angled upward... return true; } return false; @@ -1510,8 +1514,8 @@ float measured_z; - const float dx = float(x_max - x_min) / (g29_grid_size - 1.0), - dy = float(y_max - y_min) / (g29_grid_size - 1.0); + const float dx = float(x_max - x_min) / (g29_grid_size - 1), + dy = float(y_max - y_min) / (g29_grid_size - 1); struct linear_fit_data lsf_results; @@ -1562,12 +1566,12 @@ incremental_LSF(&lsf_results, PROBE_PT_3_X, PROBE_PT_3_Y, measured_z); } } - + STOW_PROBE(); #ifdef Z_AFTER_PROBING move_z_after_probing(); #endif - + if (abort_flag) { SERIAL_ECHOPGM("?Error probing point. Aborting operation.\n"); return; @@ -1628,13 +1632,13 @@ #ifdef Z_AFTER_PROBING move_z_after_probing(); #endif - + if (abort_flag || finish_incremental_LSF(&lsf_results)) { SERIAL_ECHOPGM("Could not complete LSF!"); return; } - vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1.0000).get_normal(); + vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1).get_normal(); if (g29_verbose_level > 2) { SERIAL_ECHOPGM("bed plane normal = ["); @@ -1713,7 +1717,7 @@ * The only difference is just 3 points are used in the calculations. That fact guarantees * each probed point should have an exact match when a get_z_correction() for that location * is calculated. The Z error between the probed point locations and the get_z_correction() - * numbers for those locations should be 0.000 + * numbers for those locations should be 0. */ #if 0 float t, t1, d; @@ -1743,13 +1747,13 @@ SERIAL_EOL(); t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + normal.z * 0.000; + d = t + normal.z * 0; SERIAL_ECHOPGM("D from home location with Z=0 : "); SERIAL_ECHO_F(d, 6); SERIAL_EOL(); t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT); // normal.z * 0.000; + d = t + get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT); // normal.z * 0; SERIAL_ECHOPGM("D from home location using mesh value for Z: "); SERIAL_ECHO_F(d, 6); @@ -1800,7 +1804,7 @@ if (TEST(bitmap[jx], jy)) { const float ry = mesh_index_to_ypos(jy), rz = z_values[jx][jy], - w = 1.0 + weight_scaled / HYPOT((rx - px), (ry - py)); + w = 1 + weight_scaled / HYPOT((rx - px), (ry - py)); incremental_WLSF(&lsf_results, rx, ry, rz, w); } } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index 4900f0e0df..85ed86838e 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -102,7 +102,7 @@ FINAL_MOVE: // The distance is always MESH_X_DIST so multiply by the constant reciprocal. - const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * (1.0 / (MESH_X_DIST)); + const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * (1.0f / (MESH_X_DIST)); float z1 = z_values[cell_dest_xi ][cell_dest_yi ] + xratio * (z_values[cell_dest_xi + 1][cell_dest_yi ] - z_values[cell_dest_xi][cell_dest_yi ]), @@ -112,7 +112,7 @@ if (cell_dest_xi >= GRID_MAX_POINTS_X - 1) z1 = z2 = 0.0; // X cell-fraction done. Interpolate the two Z offsets with the Y fraction for the final Z offset. - const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * (1.0 / (MESH_Y_DIST)), + const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * (1.0f / (MESH_Y_DIST)), z0 = cell_dest_yi < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end[Z_AXIS]) : 0.0; // Undefined parts of the Mesh in z_values[][] are NAN. @@ -440,14 +440,14 @@ #if IS_KINEMATIC const float seconds = cartesian_xy_mm / feedrate; // seconds to move xy distance at requested rate uint16_t segments = lroundf(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate - seglimit = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length + seglimit = lroundf(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length NOMORE(segments, seglimit); // limit to minimum segment length (fewer segments) #else - uint16_t segments = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length + uint16_t segments = lroundf(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length #endif NOLESS(segments, 1U); // must have at least one segment - const float inv_segments = 1.0 / segments; // divide once, multiply thereafter + const float inv_segments = 1.0f / segments; // divide once, multiply thereafter #if IS_SCARA // scale the feed rate from mm/s to degrees/s scara_feed_factor = cartesian_xy_mm * inv_segments * feedrate; @@ -500,8 +500,8 @@ // in top of loop and again re-find same adjacent cell and use it, just less efficient // for mesh inset area. - int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)), - cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); + int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)), + cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1); cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1); @@ -522,15 +522,15 @@ float cx = raw[X_AXIS] - x0, // cell-relative x and y cy = raw[Y_AXIS] - y0; - const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0 / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right) - z_xmy1 = (z_x1y1 - z_x0y1) * (1.0 / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right) + const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0f / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right) + z_xmy1 = (z_x1y1 - z_x0y1) * (1.0f / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right) float z_cxy0 = z_x0y0 + z_xmy0 * cx; // z height along y0 at cx (changes for each cx in cell) const float z_cxy1 = z_x0y1 + z_xmy1 * cx, // z height along y1 at cx z_cxyd = z_cxy1 - z_cxy0; // z height difference along cx from y0 to y1 - float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell) + float z_cxym = z_cxyd * (1.0f / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell) // float z_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop) @@ -539,7 +539,7 @@ // each change by a constant for fixed segment lengths. const float z_sxy0 = z_xmy0 * diff[X_AXIS], // per-segment adjustment to z_cxy0 - z_sxym = (z_xmy1 - z_xmy0) * (1.0 / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym + z_sxym = (z_xmy1 - z_xmy0) * (1.0f / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym for (;;) { // for all segments within this mesh cell diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index 458eb61f1a..b5ea77a029 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -91,8 +91,8 @@ void dac_current_raw(uint8_t channel, uint16_t val) { mcp4728_simpleCommand(UPDATE); } -static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * (1.0 / (DAC_STEPPER_MAX)); } -static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0 / (DAC_STEPPER_SENSE)); } +static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * (1.0f / (DAC_STEPPER_MAX)); } +static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0f / (DAC_STEPPER_SENSE)); } uint8_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } void dac_current_set_percents(const uint8_t pct[XYZE]) { diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 12a180e7d4..e59c3d5269 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -87,7 +87,7 @@ static void i2c_send(const uint8_t channel, const byte v) { // This is for the MCP4018 I2C based digipot void digipot_i2c_set_current(const uint8_t channel, const float current) { - i2c_send(channel, current_to_wiper(MIN(MAX(current, 0.0f), float(DIGIPOT_A4988_MAX_CURRENT)))); + i2c_send(channel, current_to_wiper(MIN(MAX(current, 0), float(DIGIPOT_A4988_MAX_CURRENT)))); } void digipot_i2c_init() { diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index ca02977f85..4609a2c217 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -69,7 +69,7 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) { // Set actual wiper value byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 }; - i2c_send(addr, addresses[channel & 0x3], current_to_wiper(MIN((float) MAX(current, 0.0f), DIGIPOT_I2C_MAX_CURRENT))); + i2c_send(addr, addresses[channel & 0x3], current_to_wiper(MIN((float) MAX(current, 0), DIGIPOT_I2C_MAX_CURRENT))); } void digipot_i2c_init() { diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index d2188c7c7a..62e66122ef 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -376,11 +376,9 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u if (retract && thermalManager.hotEnoughToExtrude(active_extruder)) do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE); - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (!axis_unhomed_error()) - #endif - // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos) - Nozzle::park(2, park_point); + // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos) + if (!axis_unhomed_error()) + Nozzle::park(2, park_point); // Unload the filament if (unload_length) diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index b879a26341..0958588373 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -43,55 +43,76 @@ job_recovery_info_t job_recovery_info; JobRecoveryPhase job_recovery_phase = JOB_RECOVERY_IDLE; uint8_t job_recovery_commands_count; //=0 char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; - -// Private -static char sd_filename[MAXPATHNAMELENGTH]; +// Extern +extern uint8_t active_extruder, commands_in_queue, cmd_queue_index_r; #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) void debug_print_job_recovery(const bool recovery) { - SERIAL_PROTOCOLPAIR("valid_head:", (int)job_recovery_info.valid_head); - SERIAL_PROTOCOLLNPAIR(" valid_foot:", (int)job_recovery_info.valid_foot); + SERIAL_PROTOCOLLNPGM("---- Job Recovery Info ----"); + SERIAL_PROTOCOLPAIR("valid_head:", int(job_recovery_info.valid_head)); + SERIAL_PROTOCOLLNPAIR(" valid_foot:", int(job_recovery_info.valid_foot)); if (job_recovery_info.valid_head) { if (job_recovery_info.valid_head == job_recovery_info.valid_foot) { - SERIAL_PROTOCOLPGM("current_position"); - LOOP_XYZE(i) SERIAL_PROTOCOLPAIR(": ", job_recovery_info.current_position[i]); + SERIAL_PROTOCOLPGM("current_position: "); + LOOP_XYZE(i) { + SERIAL_PROTOCOL(job_recovery_info.current_position[i]); + if (i < E_AXIS) SERIAL_CHAR(','); + } SERIAL_EOL(); SERIAL_PROTOCOLLNPAIR("feedrate: ", job_recovery_info.feedrate); - SERIAL_PROTOCOLPGM("target_temperature"); - HOTEND_LOOP() SERIAL_PROTOCOLPAIR(": ", job_recovery_info.target_temperature[e]); - SERIAL_EOL(); - SERIAL_PROTOCOLPGM("fanSpeeds"); - for(uint8_t i = 0; i < FAN_COUNT; i++) SERIAL_PROTOCOLPAIR(": ", job_recovery_info.fanSpeeds[i]); + + #if HOTENDS > 1 + SERIAL_PROTOCOLLNPAIR("active_hotend: ", int(job_recovery_info.active_hotend)); + #endif + + SERIAL_PROTOCOLPGM("target_temperature: "); + HOTEND_LOOP() { + SERIAL_PROTOCOL(job_recovery_info.target_temperature[e]); + if (e < HOTENDS - 1) SERIAL_CHAR(','); + } SERIAL_EOL(); + + #if HAS_HEATED_BED + SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed); + #endif + + #if FAN_COUNT + SERIAL_PROTOCOLPGM("fanSpeeds: "); + for (int8_t i = 0; i < FAN_COUNT; i++) { + SERIAL_PROTOCOL(job_recovery_info.fanSpeeds[i]); + if (i < FAN_COUNT - 1) SERIAL_CHAR(','); + } + SERIAL_EOL(); + #endif + #if HAS_LEVELING SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling)); SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade)); #endif - #if HAS_HEATED_BED - SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed); - #endif - SERIAL_PROTOCOLLNPAIR("cmd_queue_index_r: ", job_recovery_info.cmd_queue_index_r); - SERIAL_PROTOCOLLNPAIR("commands_in_queue: ", job_recovery_info.commands_in_queue); + SERIAL_PROTOCOLLNPAIR("cmd_queue_index_r: ", int(job_recovery_info.cmd_queue_index_r)); + SERIAL_PROTOCOLLNPAIR("commands_in_queue: ", int(job_recovery_info.commands_in_queue)); if (recovery) for (uint8_t i = 0; i < job_recovery_commands_count; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_commands[i]); else for (uint8_t i = 0; i < job_recovery_info.commands_in_queue; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_info.command_queue[i]); - SERIAL_PROTOCOLLNPAIR("sd_filename: ", sd_filename); + SERIAL_PROTOCOLLNPAIR("sd_filename: ", job_recovery_info.sd_filename); SERIAL_PROTOCOLLNPAIR("sdpos: ", job_recovery_info.sdpos); SERIAL_PROTOCOLLNPAIR("print_job_elapsed: ", job_recovery_info.print_job_elapsed); } else SERIAL_PROTOCOLLNPGM("INVALID DATA"); } + SERIAL_PROTOCOLLNPGM("---------------------------"); } #endif // DEBUG_POWER_LOSS_RECOVERY /** - * Check for Print Job Recovery - * If the file has a saved state, populate the job_recovery_commands queue + * Check for Print Job Recovery during setup() + * + * If a saved state exists, populate job_recovery_commands with + * commands to restore the machine state and continue the file. */ -void do_print_job_recovery() { - //if (job_recovery_commands_count > 0) return; +void check_print_job_recovery() { memset(&job_recovery_info, 0, sizeof(job_recovery_info)); ZERO(job_recovery_commands); @@ -100,7 +121,7 @@ void do_print_job_recovery() { if (card.cardOK) { #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPAIR("Init job recovery info. Size: ", (int)sizeof(job_recovery_info)); + SERIAL_PROTOCOLLNPAIR("Init job recovery info. Size: ", int(sizeof(job_recovery_info))); #endif if (card.jobRecoverFileExists()) { @@ -120,18 +141,24 @@ void do_print_job_recovery() { strcpy_P(job_recovery_commands[ind++], PSTR("G92.0 Z0")); // Ensure Z is equal to 0 strcpy_P(job_recovery_commands[ind++], PSTR("G1 Z2")); // Raise Z by 2mm (we hope!) strcpy_P(job_recovery_commands[ind++], PSTR("G28 R0" - #if !IS_KINEMATIC + #if ENABLED(MARLIN_DEV_MODE) + " S" + #elif !IS_KINEMATIC " X Y" // Home X and Y for Cartesian #endif )); + char str_1[16], str_2[16]; + #if HAS_LEVELING - // Restore leveling state before G92 sets Z - // This ensures the steppers correspond to the native Z - sprintf_P(job_recovery_commands[ind++], PSTR("M420 S%i Z%s"), int(job_recovery_info.leveling), job_recovery_info.fade); + if (job_recovery_info.fade || job_recovery_info.leveling) { + // Restore leveling state before G92 sets Z + // This ensures the steppers correspond to the native Z + dtostrf(job_recovery_info.fade, 1, 1, str_1); + sprintf_P(job_recovery_commands[ind++], PSTR("M420 S%i Z%s"), int(job_recovery_info.leveling), str_1); + } #endif - char str_1[16], str_2[16]; dtostrf(job_recovery_info.current_position[Z_AXIS] + 2, 1, 3, str_1); dtostrf(job_recovery_info.current_position[E_AXIS] #if ENABLED(SAVE_EACH_CMD_MODE) @@ -141,23 +168,21 @@ void do_print_job_recovery() { ); sprintf_P(job_recovery_commands[ind++], PSTR("G92.0 Z%s E%s"), str_1, str_2); // Current Z + 2 and E - strcpy_P(job_recovery_commands[ind++], PSTR("M117 Continuing...")); - - uint8_t r = job_recovery_info.cmd_queue_index_r; - while (job_recovery_info.commands_in_queue) { + uint8_t r = job_recovery_info.cmd_queue_index_r, c = job_recovery_info.commands_in_queue; + while (c--) { strcpy(job_recovery_commands[ind++], job_recovery_info.command_queue[r]); - job_recovery_info.commands_in_queue--; r = (r + 1) % BUFSIZE; } + if (job_recovery_info.sd_filename[0] == '/') job_recovery_info.sd_filename[0] = ' '; + sprintf_P(job_recovery_commands[ind++], PSTR("M23 %s"), job_recovery_info.sd_filename); + sprintf_P(job_recovery_commands[ind++], PSTR("M24 S%ld T%ld"), job_recovery_info.sdpos, job_recovery_info.print_job_elapsed); + job_recovery_commands_count = ind; #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) debug_print_job_recovery(true); #endif - - card.openFile(sd_filename, true); - card.setIndex(job_recovery_info.sdpos); } else { if (job_recovery_info.valid_head != job_recovery_info.valid_foot) @@ -169,7 +194,7 @@ void do_print_job_recovery() { } /** - * Save the current machine state to the "bin" file + * Save the current machine state to the power-loss recovery file */ void save_job_recovery_info() { #if SAVE_INFO_INTERVAL_MS > 0 @@ -177,12 +202,19 @@ void save_job_recovery_info() { millis_t ms = millis(); #endif if ( - #if SAVE_INFO_INTERVAL_MS > 0 - ELAPSED(ms, next_save_ms) || - #endif + // Save on every command #if ENABLED(SAVE_EACH_CMD_MODE) true #else + // Save if power loss pin is triggered + #if PIN_EXISTS(POWER_LOSS) + READ(POWER_LOSS_PIN) == POWER_LOSS_STATE || + #endif + // Save if interval is elapsed + #if SAVE_INFO_INTERVAL_MS > 0 + ELAPSED(ms, next_save_ms) || + #endif + // Save on every new Z height (current_position[Z_AXIS] > 0 && current_position[Z_AXIS] > job_recovery_info.current_position[Z_AXIS]) #endif ) { @@ -197,11 +229,20 @@ void save_job_recovery_info() { // Machine state COPY(job_recovery_info.current_position, current_position); job_recovery_info.feedrate = feedrate_mm_s; + + #if HOTENDS > 1 + job_recovery_info.active_hotend = active_extruder; + #endif + COPY(job_recovery_info.target_temperature, thermalManager.target_temperature); + #if HAS_HEATED_BED job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed; #endif - COPY(job_recovery_info.fanSpeeds, fanSpeeds); + + #if FAN_COUNT + COPY(job_recovery_info.fanSpeeds, fanSpeeds); + #endif #if HAS_LEVELING job_recovery_info.leveling = planner.leveling_active; @@ -220,19 +261,24 @@ void save_job_recovery_info() { COPY(job_recovery_info.command_queue, command_queue); // Elapsed print job time - job_recovery_info.print_job_elapsed = print_job_timer.duration() * 1000UL; + job_recovery_info.print_job_elapsed = print_job_timer.duration(); // SD file position - card.getAbsFilename(sd_filename); + card.getAbsFilename(job_recovery_info.sd_filename); job_recovery_info.sdpos = card.getIndex(); #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPGM("Saving job_recovery_info"); + SERIAL_PROTOCOLLNPGM("Saving..."); debug_print_job_recovery(false); #endif card.openJobRecoveryFile(false); (void)card.saveJobRecoveryInfo(); + + // If power-loss pin was triggered, write just once then kill + #if PIN_EXISTS(POWER_LOSS) + if (READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) kill(MSG_POWER_LOSS_RECOVERY); + #endif } } diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index d08b500247..46a8fd52de 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -40,13 +40,21 @@ typedef struct { // Machine state float current_position[NUM_AXIS], feedrate; - int16_t target_temperature[HOTENDS], - fanSpeeds[FAN_COUNT]; + + #if HOTENDS > 1 + uint8_t active_hotend; + #endif + + int16_t target_temperature[HOTENDS]; #if HAS_HEATED_BED int16_t target_temperature_bed; #endif + #if FAN_COUNT + int16_t fanSpeeds[FAN_COUNT]; + #endif + #if HAS_LEVELING bool leveling; float fade; @@ -56,7 +64,8 @@ typedef struct { uint8_t cmd_queue_index_r, commands_in_queue; char command_queue[BUFSIZE][MAX_CMD_SIZE]; - // SD File position + // SD Filename and position + char sd_filename[MAXPATHNAMELENGTH]; uint32_t sdpos; // Job elapsed time @@ -70,20 +79,21 @@ extern job_recovery_info_t job_recovery_info; enum JobRecoveryPhase : unsigned char { JOB_RECOVERY_IDLE, JOB_RECOVERY_MAYBE, - JOB_RECOVERY_YES + JOB_RECOVERY_YES, + JOB_RECOVERY_DONE }; extern JobRecoveryPhase job_recovery_phase; #if HAS_LEVELING - #define APPEND_CMD_COUNT 7 + #define APPEND_CMD_COUNT 9 #else - #define APPEND_CMD_COUNT 5 + #define APPEND_CMD_COUNT 7 #endif extern char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; extern uint8_t job_recovery_commands_count; -void do_print_job_recovery(); +void check_print_job_recovery(); void save_job_recovery_info(); #endif // _POWER_LOSS_RECOVERY_H_ diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index a5dc428592..c7d6cacb10 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -52,7 +52,7 @@ bool report_tmc_status = false; bool is_ot; bool is_error; }; - #if ENABLED(HAVE_TMC2130) + #if HAS_DRIVER(TMC2130) static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); } static uint8_t get_status_response(TMC2130Stepper &st) { return st.status_response & 0xF; } static TMC_driver_data get_driver_data(TMC2130Stepper &st) { @@ -70,7 +70,7 @@ bool report_tmc_status = false; return data; } #endif - #if ENABLED(HAVE_TMC2208) + #if HAS_DRIVER(TMC2208) static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); } static uint8_t get_status_response(TMC2208Stepper &st) { uint32_t drv_status = st.DRV_STATUS(); @@ -159,21 +159,21 @@ bool report_tmc_status = false; } } - #define HAS_HW_COMMS(ST) ENABLED(ST##_IS_TMC2130)|| (ENABLED(ST##_IS_TMC2208) && defined(ST##_HARDWARE_SERIAL)) + #define HAS_HW_COMMS(ST) AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && defined(ST##_HARDWARE_SERIAL)) void monitor_tmc_driver() { static millis_t next_cOT = 0; if (ELAPSED(millis(), next_cOT)) { next_cOT = millis() + 500; - #if HAS_HW_COMMS(X) || ENABLED(IS_TRAMS) + #if HAS_HW_COMMS(X) static uint8_t x_otpw_cnt = 0; monitor_tmc_driver(stepperX, TMC_X, x_otpw_cnt); #endif - #if HAS_HW_COMMS(Y) || ENABLED(IS_TRAMS) + #if HAS_HW_COMMS(Y) static uint8_t y_otpw_cnt = 0; monitor_tmc_driver(stepperY, TMC_Y, y_otpw_cnt); #endif - #if HAS_HW_COMMS(Z) || ENABLED(IS_TRAMS) + #if HAS_HW_COMMS(Z) static uint8_t z_otpw_cnt = 0; monitor_tmc_driver(stepperZ, TMC_Z, z_otpw_cnt); #endif @@ -189,7 +189,7 @@ bool report_tmc_status = false; static uint8_t z2_otpw_cnt = 0; monitor_tmc_driver(stepperZ2, TMC_Z, z2_otpw_cnt); #endif - #if HAS_HW_COMMS(E0) || ENABLED(IS_TRAMS) + #if HAS_HW_COMMS(E0) static uint8_t e0_otpw_cnt = 0; monitor_tmc_driver(stepperE0, TMC_E0, e0_otpw_cnt); #endif @@ -311,7 +311,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { SERIAL_EOL(); } - #if ENABLED(HAVE_TMC2130) + #if HAS_DRIVER(TMC2130) static void tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { switch (i) { case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; @@ -331,7 +331,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { } #endif - #if ENABLED(HAVE_TMC2208) + #if HAS_DRIVER(TMC2208) static void tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { switch (i) { case TMC_TSTEP: { uint32_t data = 0; st.TSTEP(&data); SERIAL_PROTOCOL(data); break; } @@ -420,52 +420,52 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { } static void tmc_debug_loop(const TMC_debug_enum i) { - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) tmc_status(stepperX, TMC_X, i, planner.axis_steps_per_mm[X_AXIS]); #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) tmc_status(stepperX2, TMC_X2, i, planner.axis_steps_per_mm[X_AXIS]); #endif - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) tmc_status(stepperY, TMC_Y, i, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) tmc_status(stepperY2, TMC_Y2, i, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) tmc_status(stepperZ, TMC_Z, i, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) tmc_status(stepperZ2, TMC_Z2, i, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) tmc_status(stepperE0, TMC_E0, i, planner.axis_steps_per_mm[E_AXIS]); #endif - #if E1_IS_TRINAMIC + #if AXIS_IS_TMC(E1) tmc_status(stepperE1, TMC_E1, i, planner.axis_steps_per_mm[E_AXIS #if ENABLED(DISTINCT_E_FACTORS) + 1 #endif ]); #endif - #if E2_IS_TRINAMIC + #if AXIS_IS_TMC(E2) tmc_status(stepperE2, TMC_E2, i, planner.axis_steps_per_mm[E_AXIS #if ENABLED(DISTINCT_E_FACTORS) + 2 #endif ]); #endif - #if E3_IS_TRINAMIC + #if AXIS_IS_TMC(E3) tmc_status(stepperE3, TMC_E3, i, planner.axis_steps_per_mm[E_AXIS #if ENABLED(DISTINCT_E_FACTORS) + 3 #endif ]); #endif - #if E4_IS_TRINAMIC + #if AXIS_IS_TMC(E4) tmc_status(stepperE4, TMC_E4, i, planner.axis_steps_per_mm[E_AXIS #if ENABLED(DISTINCT_E_FACTORS) + 4 @@ -477,40 +477,40 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { } static void drv_status_loop(const TMC_drv_status_enum i) { - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) tmc_parse_drv_status(stepperX, TMC_X, i); #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) tmc_parse_drv_status(stepperX2, TMC_X2, i); #endif - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) tmc_parse_drv_status(stepperY, TMC_Y, i); #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) tmc_parse_drv_status(stepperY2, TMC_Y2, i); #endif - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) tmc_parse_drv_status(stepperZ, TMC_Z, i); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) tmc_parse_drv_status(stepperZ2, TMC_Z2, i); #endif - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) tmc_parse_drv_status(stepperE0, TMC_E0, i); #endif - #if E1_IS_TRINAMIC + #if AXIS_IS_TMC(E1) tmc_parse_drv_status(stepperE1, TMC_E1, i); #endif - #if E2_IS_TRINAMIC + #if AXIS_IS_TMC(E2) tmc_parse_drv_status(stepperE2, TMC_E2, i); #endif - #if E3_IS_TRINAMIC + #if AXIS_IS_TMC(E3) tmc_parse_drv_status(stepperE3, TMC_E3, i); #endif - #if E4_IS_TRINAMIC + #if AXIS_IS_TMC(E4) tmc_parse_drv_status(stepperE4, TMC_E4, i); #endif @@ -553,7 +553,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { TMC_REPORT("Stallguard thrs", TMC_SGT); DRV_REPORT("DRVSTATUS", TMC_DRV_CODES); - #if ENABLED(HAVE_TMC2130) + #if HAS_DRIVER(TMC2130) DRV_REPORT("stallguard\t", TMC_STALLGUARD); DRV_REPORT("sg_result\t", TMC_SG_RESULT); DRV_REPORT("fsactive\t", TMC_FSACTIVE); @@ -565,7 +565,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { DRV_REPORT("s2ga\t", TMC_S2GA); DRV_REPORT("otpw\t", TMC_DRV_OTPW); DRV_REPORT("ot\t", TMC_OT); - #if ENABLED(HAVE_TMC2208) + #if HAS_DRIVER(TMC2208) DRV_REPORT("157C\t", TMC_T157); DRV_REPORT("150C\t", TMC_T150); DRV_REPORT("143C\t", TMC_T143); @@ -591,43 +591,43 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { #endif // SENSORLESS_HOMING -#if ENABLED(HAVE_TMC2130) +#if HAS_DRIVER(TMC2130) #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH) void tmc_init_cs_pins() { - #if ENABLED(X_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X, TMC2130) SET_CS_PIN(X); #endif - #if ENABLED(Y_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y, TMC2130) SET_CS_PIN(Y); #endif - #if ENABLED(Z_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z, TMC2130) SET_CS_PIN(Z); #endif - #if ENABLED(X2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X2, TMC2130) SET_CS_PIN(X2); #endif - #if ENABLED(Y2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y2, TMC2130) SET_CS_PIN(Y2); #endif - #if ENABLED(Z2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z2, TMC2130) SET_CS_PIN(Z2); #endif - #if ENABLED(E0_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E0, TMC2130) SET_CS_PIN(E0); #endif - #if ENABLED(E1_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E1, TMC2130) SET_CS_PIN(E1); #endif - #if ENABLED(E2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E2, TMC2130) SET_CS_PIN(E2); #endif - #if ENABLED(E3_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E3, TMC2130) SET_CS_PIN(E3); #endif - #if ENABLED(E4_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E4, TMC2130) SET_CS_PIN(E4); #endif } -#endif // HAVE_TMC2130 +#endif // TMC2130 #endif // HAS_TRINAMIC diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 094b65e9b7..6f11955ac5 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -25,11 +25,11 @@ #include "../inc/MarlinConfigPre.h" -#if ENABLED(HAVE_TMC2130) +#if HAS_DRIVER(TMC2130) #include #endif -#if ENABLED(HAVE_TMC2208) +#if HAS_DRIVER(TMC2208) #include #endif @@ -100,7 +100,7 @@ void monitor_tmc_driver(); void tmc_sensorless_homing(TMC2130Stepper &st, const bool enable=true); #endif -#if ENABLED(HAVE_TMC2130) +#if HAS_DRIVER(TMC2130) void tmc_init_cs_pins(); #endif diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index 2b950ef718..bdf33a0a28 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -211,4 +211,4 @@ void GcodeSuite::M420() { report_current_position(); } -#endif // HAS_LEVELING \ No newline at end of file +#endif // HAS_LEVELING diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index c98bc6b9fa..c711b9deed 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -62,6 +62,12 @@ #endif #endif +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_RETURN(b) return b; +#else + #define G29_RETURN(b) return; +#endif + /** * G29: Detailed Z probe, probes the bed at 3 or more points. * Will fail if the printer has not been homed with G28. @@ -136,7 +142,7 @@ * There's no extra effect if you have a fixed Z probe. * */ -void GcodeSuite::G29() { +G29_TYPE GcodeSuite::G29() { #if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY) const bool seenQ = parser.seen('Q'); @@ -154,7 +160,7 @@ void GcodeSuite::G29() { } marlin_debug_flags = old_debug_flags; #if DISABLED(PROBE_MANUALLY) - if (seenQ) return; + if (seenQ) G29_RETURN(false); #endif #endif @@ -174,7 +180,7 @@ void GcodeSuite::G29() { ; // Don't allow auto-leveling without homing first - if (axis_unhomed_error()) return; + if (axis_unhomed_error()) G29_RETURN(false); if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -183,7 +189,7 @@ void GcodeSuite::G29() { SERIAL_ECHOLNPGM("<<< G29"); } #endif - return; + G29_RETURN(false); } // Define local vars 'static' for manual probing, 'auto' otherwise @@ -285,14 +291,14 @@ void GcodeSuite::G29() { if (!leveling_is_valid()) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("No bilinear grid"); - return; + G29_RETURN(false); } const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position[Z_AXIS]; if (!WITHIN(rz, -10, 10)) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Bad Z value"); - return; + G29_RETURN(false); } const float rx = RAW_X_POSITION(parser.linearval('X', NAN)), @@ -316,7 +322,7 @@ void GcodeSuite::G29() { set_bed_leveling_enabled(abl_should_enable); if (abl_should_enable) report_current_position(); } - return; + G29_RETURN(false); } // parser.seen('W') #else @@ -328,13 +334,13 @@ void GcodeSuite::G29() { // Jettison bed leveling data if (!seen_w && parser.seen('J')) { reset_bed_level(); - return; + G29_RETURN(false); } verbose_level = parser.intval('V'); if (!WITHIN(verbose_level, 0, 4)) { SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4)."); - return; + G29_RETURN(false); } dryrun = parser.boolval('D') @@ -355,11 +361,11 @@ void GcodeSuite::G29() { if (!WITHIN(abl_grid_points_x, 2, GRID_MAX_POINTS_X)) { SERIAL_PROTOCOLLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); - return; + G29_RETURN(false); } if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) { SERIAL_PROTOCOLLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); - return; + G29_RETURN(false); } abl_points = abl_grid_points_x * abl_grid_points_y; @@ -392,7 +398,7 @@ void GcodeSuite::G29() { #endif ) { SERIAL_PROTOCOLLNPGM("? (L,R,F,B) out of bounds."); - return; + G29_RETURN(false); } // probe at the points of a lattice grid @@ -417,7 +423,7 @@ void GcodeSuite::G29() { // Deploy the probe. Probe will raise if needed. if (DEPLOY_PROBE()) { set_bed_leveling_enabled(abl_should_enable); - return; + G29_RETURN(false); } #endif @@ -494,7 +500,7 @@ void GcodeSuite::G29() { SERIAL_PROTOCOLLNPGM("idle"); } - if (no_action) return; + if (no_action) G29_RETURN(false); if (abl_probe_index == 0) { // For the initial G29 S2 save software endstop state @@ -584,7 +590,7 @@ void GcodeSuite::G29() { // If G29 is not completed, they will not be re-enabled soft_endstops_enabled = false; #endif - return; + G29_RETURN(false); } else { @@ -610,7 +616,7 @@ void GcodeSuite::G29() { // If G29 is not completed, they will not be re-enabled soft_endstops_enabled = false; #endif - return; + G29_RETURN(false); } else { @@ -990,6 +996,8 @@ void GcodeSuite::G29() { #endif report_current_position(); + + G29_RETURN(isnan(measured_z)); } #endif // OLDSCHOOL_ABL diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 191c2d20ec..c512edde0c 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -72,7 +72,9 @@ #endif do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s); - endstops.hit_on_purpose(); // clear endstop hit flags + + endstops.validate_homing_move(); + current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; #if ENABLED(SENSORLESS_HOMING) @@ -129,7 +131,7 @@ #endif do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]); - HOMEAXIS(Z); + homeaxis(Z_AXIS); } else { LCD_MESSAGEPGM(MSG_ZPROBE_OUT); @@ -172,6 +174,19 @@ void GcodeSuite::G28(const bool always_home_all) { } #endif + #if ENABLED(MARLIN_DEV_MODE) + if (parser.seen('S')) { + LOOP_XYZ(a) set_axis_is_at_home((AxisEnum)a); + SYNC_PLAN_POSITION_KINEMATIC(); + SERIAL_ECHOLNPGM("Simulated Homing"); + report_current_position(); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); + #endif + return; + } + #endif + if (all_axes_known() && parser.boolval('O')) { // home only if needed #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -203,8 +218,7 @@ void GcodeSuite::G28(const bool always_home_all) { #endif #if ENABLED(BLTOUCH) - bltouch_command(BLTOUCH_RESET); - set_bltouch_deployed(false); + bltouch_init(); #endif // Always home with tool 0 active @@ -241,7 +255,7 @@ void GcodeSuite::G28(const bool always_home_all) { #if Z_HOME_DIR > 0 // If homing away from BED do Z first - if (home_all || homeZ) HOMEAXIS(Z); + if (home_all || homeZ) homeaxis(Z_AXIS); #endif @@ -279,7 +293,7 @@ void GcodeSuite::G28(const bool always_home_all) { #if ENABLED(CODEPENDENT_XY_HOMING) || homeX #endif - ) HOMEAXIS(Y); + ) homeaxis(Y_AXIS); #endif @@ -294,14 +308,14 @@ void GcodeSuite::G28(const bool always_home_all) { // Always home the 2nd (right) extruder first active_extruder = 1; - HOMEAXIS(X); + homeaxis(X_AXIS); // Remember this extruder's position for later tool change inactive_extruder_x_pos = current_position[X_AXIS]; // Home the 1st (left) extruder active_extruder = 0; - HOMEAXIS(X); + homeaxis(X_AXIS); // Consider the active extruder to be parked COPY(raised_parked_position, current_position); @@ -310,14 +324,14 @@ void GcodeSuite::G28(const bool always_home_all) { #else - HOMEAXIS(X); + homeaxis(X_AXIS); #endif } // Home Y (after X) #if DISABLED(HOME_Y_BEFORE_X) - if (home_all || homeY) HOMEAXIS(Y); + if (home_all || homeY) homeaxis(Y_AXIS); #endif // Home Z last if homing towards the bed @@ -326,7 +340,7 @@ void GcodeSuite::G28(const bool always_home_all) { #if ENABLED(Z_SAFE_HOMING) home_z_safely(); #else - HOMEAXIS(Z); + homeaxis(Z_AXIS); #endif #if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 78b48790f9..404da70d4f 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -72,12 +72,10 @@ enum CalEnum : char { // the 7 main calibration points - float lcd_probe_pt(const float &rx, const float &ry); -bool ac_home() { +void ac_home() { endstops.enable(true); - if (!home_delta()) - return false; + home_delta(); endstops.not_homing(); - return true; } void ac_setup(const bool reset_bed) { @@ -187,7 +185,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool S2 += sq(z_pt[rad]); N++; } - return round(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; + return LROUND(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; } } return 0.00001; @@ -247,7 +245,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi } if (_7p_calibration) { // probe extra center points - const float start = _7p_9_center ? _CA + _7P_STEP / 3.0 : _7p_6_center ? _CA : __C, + const float start = _7p_9_center ? float(_CA) + _7P_STEP / 3.0 : _7p_6_center ? float(_CA) : float(__C), steps = _7p_9_center ? _4P_STEP / 3.0 : _7p_6_center ? _7P_STEP : _4P_STEP; I_LOOP_CAL_PT(rad, start, steps) { const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), @@ -279,8 +277,8 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi const float z_temp = calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up); if (isnan(z_temp)) return false; // split probe point to neighbouring calibration points - z_pt[uint8_t(round(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); - z_pt[uint8_t(round(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); + z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); + z_pt[uint8_t(LROUND(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); } zig_zag = !zig_zag; } @@ -361,7 +359,7 @@ static float auto_tune_h() { float h_fac = 0.0; h_fac = r_quot / (2.0 / 3.0); - h_fac = 1.0 / h_fac; // (2/3)/CR + h_fac = 1.0f / h_fac; // (2/3)/CR return h_fac; } @@ -530,8 +528,7 @@ void GcodeSuite::G33() { ac_setup(!_0p_calibration && !_1p_calibration); - if (!_0p_calibration) - if (!ac_home()) return; + if (!_0p_calibration) ac_home(); do { // start iterations @@ -683,9 +680,9 @@ void GcodeSuite::G33() { char mess[21]; strcpy_P(mess, PSTR("Calibration sd:")); if (zero_std_dev_min < 1) - sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev_min * 1000.0)); + sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev_min * 1000.0)); else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)round(zero_std_dev_min)); + sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); lcd_setstatus(mess); print_calibration_settings(_endstop_results, _angle_results); serialprintPGM(save_message); @@ -719,12 +716,12 @@ void GcodeSuite::G33() { strcpy_P(mess, enddryrun); strcpy_P(&mess[11], PSTR(" sd:")); if (zero_std_dev < 1) - sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev * 1000.0)); + sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev * 1000.0)); else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)round(zero_std_dev)); + sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev)); lcd_setstatus(mess); } - if (!ac_home()) return; + ac_home(); } while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision); diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 3b5a18bbdd..dd646961f7 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -111,7 +111,7 @@ void GcodeSuite::M48() { setup_for_endstop_or_probe_move(); - double mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples]; + float mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples]; // Move to the first point, deploy, and probe const float t = probe_pt(X_probe_location, Y_probe_location, raise_after, verbose_level); @@ -142,7 +142,7 @@ void GcodeSuite::M48() { } for (uint8_t l = 0; l < n_legs - 1; l++) { - double delta_angle; + float delta_angle; if (schizoid_flag) // The points of a 5 point star are 72 degrees apart. We need to @@ -199,7 +199,7 @@ void GcodeSuite::M48() { /** * Get the current mean for the data points we have so far */ - double sum = 0.0; + float sum = 0.0; for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; mean = sum / (n + 1); diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index c73f8da3cc..cd45047be6 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -40,7 +40,7 @@ // setting any extruder filament size disables volumetric on the assumption that // slicers either generate in extruder values as cubic mm or as as filament feeds // for all extruders - if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0.0)) ) + if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0)) ) planner.set_filament_size(target_extruder, parser.value_linear_units()); } planner.calculate_volumetric_multipliers(); @@ -134,9 +134,9 @@ void GcodeSuite::M205() { #if ENABLED(JUNCTION_DEVIATION) if (parser.seen('J')) { const float junc_dev = parser.value_linear_units(); - if (WITHIN(junc_dev, 0.01, 0.3)) { + if (WITHIN(junc_dev, 0.01f, 0.3f)) { planner.junction_deviation_mm = junc_dev; - planner.recalculate_max_e_jerk_factor(); + planner.recalculate_max_e_jerk(); } else { SERIAL_ERROR_START(); @@ -149,7 +149,7 @@ void GcodeSuite::M205() { if (parser.seen('Z')) { planner.max_jerk[Z_AXIS] = parser.value_linear_units(); #if HAS_MESH - if (planner.max_jerk[Z_AXIS] <= 0.1) + if (planner.max_jerk[Z_AXIS] <= 0.1f) SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses."); #endif } diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index c1b8ed2eec..310b754aa3 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -37,7 +37,7 @@ void GcodeSuite::M92() { if (parser.seen(axis_codes[i])) { if (i == E_AXIS) { const float value = parser.value_per_axis_unit((AxisEnum)(E_AXIS + TARGET_EXTRUDER)); - if (value < 20.0) { + if (value < 20) { float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab. #if DISABLED(JUNCTION_DEVIATION) planner.max_jerk[E_AXIS] *= factor; diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 980fc26a1a..213d17450a 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -107,12 +107,12 @@ void GcodeSuite::M3_M4(bool is_M3) { delay_for_power_down(); } else { - int16_t ocr_val = (spindle_laser_power - (SPEED_POWER_INTERCEPT)) * (1.0 / (SPEED_POWER_SLOPE)); // convert RPM to PWM duty cycle + int16_t ocr_val = (spindle_laser_power - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // convert RPM to PWM duty cycle NOMORE(ocr_val, 255); // limit to max the Atmel PWM will support if (spindle_laser_power <= SPEED_POWER_MIN) - ocr_val = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * (1.0 / (SPEED_POWER_SLOPE)); // minimum setting + ocr_val = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // minimum setting if (spindle_laser_power >= SPEED_POWER_MAX) - ocr_val = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * (1.0 / (SPEED_POWER_SLOPE)); // limit to max RPM + ocr_val = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // limit to max RPM if (SPINDLE_LASER_PWM_INVERT) ocr_val = 255 - ocr_val; WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) analogWrite(SPINDLE_LASER_PWM_PIN, ocr_val & 0xFF); // only write low byte diff --git a/Marlin/src/gcode/feature/leds/M7219.cpp b/Marlin/src/gcode/feature/leds/M7219.cpp index 36f9f7c7ca..62edcecea6 100644 --- a/Marlin/src/gcode/feature/leds/M7219.cpp +++ b/Marlin/src/gcode/feature/leds/M7219.cpp @@ -29,32 +29,53 @@ /** * M7219: Control the Max7219 LED matrix - * + * * I - Initialize (clear) the matrix + * F - Fill the matrix (set all bits) + * P - Dump the LEDs[] array values * C - Set a column to the 8-bit value V * R - Set a row to the 8-bit value V * X - X position of an LED to set or toggle * Y - Y position of an LED to set or toggle - * V - The 8-bit value or on/off state to set + * V - The potentially 32-bit value or on/off state to set + * (for example: a chain of 4 Max7219 devices can have 32 bit + * rows or columns depending upon rotation) */ void GcodeSuite::M7219() { if (parser.seen('I')) - Max7219_init(); - else if (parser.seenval('R')) { - const uint8_t r = parser.value_int(); - Max7219_Set_Row(r, parser.byteval('V')); + Max7219_Clear(); + + if (parser.seen('F')) + for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) + Max7219_Set_Column(x, 0xFFFFFFFF); + + if (parser.seenval('R')) { + const uint32_t r = parser.value_int(); + Max7219_Set_Row(r, parser.ulongval('V')); + return; } else if (parser.seenval('C')) { - const uint8_t c = parser.value_int(); - Max7219_Set_Column(c, parser.byteval('V')); + const uint32_t c = parser.value_int(); + Max7219_Set_Column(c, parser.ulongval('V')); + return; } - else if (parser.seenval('X') || parser.seenval('Y')) { + + if (parser.seenval('X') || parser.seenval('Y')) { const uint8_t x = parser.byteval('X'), y = parser.byteval('Y'); if (parser.seenval('V')) Max7219_LED_Set(x, y, parser.boolval('V')); else Max7219_LED_Toggle(x, y); } + + if (parser.seen('P')) { + for (uint8_t x = 0; x < COUNT(LEDs); x++) { + SERIAL_ECHOPAIR("LEDs[", x); + SERIAL_ECHOPAIR("]=", LEDs[x]); + SERIAL_EOL(); + } + return; + } } #endif // MAX7219_GCODE diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index 1ac22641cf..22d9a3f90a 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -42,45 +42,45 @@ void GcodeSuite::M906() { report = false; switch (i) { case X_AXIS: - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) if (index == 0) TMC_SET_CURRENT(X); #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) if (index == 1) TMC_SET_CURRENT(X2); #endif break; case Y_AXIS: - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) if (index == 0) TMC_SET_CURRENT(Y); #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) if (index == 1) TMC_SET_CURRENT(Y2); #endif break; case Z_AXIS: - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) if (index == 0) TMC_SET_CURRENT(Z); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) if (index == 1) TMC_SET_CURRENT(Z2); #endif break; case E_AXIS: { if (get_target_extruder_from_command()) return; switch (target_extruder) { - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) case 0: TMC_SET_CURRENT(E0); break; #endif - #if E1_IS_TRINAMIC + #if AXIS_IS_TMC(E1) case 1: TMC_SET_CURRENT(E1); break; #endif - #if E2_IS_TRINAMIC + #if AXIS_IS_TMC(E2) case 2: TMC_SET_CURRENT(E2); break; #endif - #if E3_IS_TRINAMIC + #if AXIS_IS_TMC(E3) case 3: TMC_SET_CURRENT(E3); break; #endif - #if E4_IS_TRINAMIC + #if AXIS_IS_TMC(E4) case 4: TMC_SET_CURRENT(E4); break; #endif } @@ -88,48 +88,40 @@ void GcodeSuite::M906() { } } - if (report) LOOP_XYZE(i) switch (i) { - case X_AXIS: - #if X_IS_TRINAMIC - TMC_SAY_CURRENT(X); - #endif - #if X2_IS_TRINAMIC - TMC_SAY_CURRENT(X2); - #endif - break; - case Y_AXIS: - #if Y_IS_TRINAMIC - TMC_SAY_CURRENT(Y); - #endif - #if Y2_IS_TRINAMIC - TMC_SAY_CURRENT(Y2); - #endif - break; - case Z_AXIS: - #if Z_IS_TRINAMIC - TMC_SAY_CURRENT(Z); - #endif - #if Z2_IS_TRINAMIC - TMC_SAY_CURRENT(Z2); - #endif - break; - case E_AXIS: - #if E0_IS_TRINAMIC - TMC_SAY_CURRENT(E0); - #endif - #if E1_IS_TRINAMIC - TMC_SAY_CURRENT(E1); - #endif - #if E2_IS_TRINAMIC - TMC_SAY_CURRENT(E2); - #endif - #if E3_IS_TRINAMIC - TMC_SAY_CURRENT(E3); - #endif - #if E4_IS_TRINAMIC - TMC_SAY_CURRENT(E4); - #endif - break; + if (report) { + #if AXIS_IS_TMC(X) + TMC_SAY_CURRENT(X); + #endif + #if AXIS_IS_TMC(X2) + TMC_SAY_CURRENT(X2); + #endif + #if AXIS_IS_TMC(Y) + TMC_SAY_CURRENT(Y); + #endif + #if AXIS_IS_TMC(Y2) + TMC_SAY_CURRENT(Y2); + #endif + #if AXIS_IS_TMC(Z) + TMC_SAY_CURRENT(Z); + #endif + #if AXIS_IS_TMC(Z2) + TMC_SAY_CURRENT(Z2); + #endif + #if AXIS_IS_TMC(E0) + TMC_SAY_CURRENT(E0); + #endif + #if AXIS_IS_TMC(E1) + TMC_SAY_CURRENT(E1); + #endif + #if AXIS_IS_TMC(E2) + TMC_SAY_CURRENT(E2); + #endif + #if AXIS_IS_TMC(E3) + TMC_SAY_CURRENT(E3); + #endif + #if AXIS_IS_TMC(E4) + TMC_SAY_CURRENT(E4); + #endif } } diff --git a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp index 8a59837658..6ba9ee5e99 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp @@ -30,37 +30,33 @@ #include "../../../module/planner.h" #include "../../queue.h" -#define M91x_USE(A) (ENABLED(A##_IS_TMC2130) || (ENABLED(A##_IS_TMC2208) && PIN_EXISTS(A##_SERIAL_RX))) +#define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && PIN_EXISTS(ST##_SERIAL_RX))) #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N)) -#define M91x_USE_X (ENABLED(IS_TRAMS) || M91x_USE(X)) -#define M91x_USE_Y (ENABLED(IS_TRAMS) || M91x_USE(Y)) -#define M91x_USE_Z (ENABLED(IS_TRAMS) || M91x_USE(Z)) -#define M91x_USE_E0 (ENABLED(IS_TRAMS) || M91x_USE_E(0)) /** * M911: Report TMC stepper driver overtemperature pre-warn flag * This flag is held by the library, persisting until cleared by M912 */ void GcodeSuite::M911() { - #if M91x_USE_X + #if M91x_USE(X) tmc_report_otpw(stepperX, TMC_X); #endif #if M91x_USE(X2) tmc_report_otpw(stepperX2, TMC_X2); #endif - #if M91x_USE_Y + #if M91x_USE(Y) tmc_report_otpw(stepperY, TMC_Y); #endif #if M91x_USE(Y2) tmc_report_otpw(stepperY2, TMC_Y2); #endif - #if M91x_USE_Z + #if M91x_USE(Z) tmc_report_otpw(stepperZ, TMC_Z); #endif #if M91x_USE(Z2) tmc_report_otpw(stepperZ2, TMC_Z2); #endif - #if M91x_USE_E0 + #if M91x_USE_E(0) tmc_report_otpw(stepperE0, TMC_E0); #endif #if M91x_USE_E(1) @@ -96,9 +92,9 @@ void GcodeSuite::M912() { hasE = parser.seen(axis_codes[E_AXIS]), hasNone = !hasX && !hasY && !hasZ && !hasE; - #if M91x_USE_X || M91x_USE(X2) + #if M91x_USE(X) || M91x_USE(X2) const uint8_t xval = parser.byteval(axis_codes[X_AXIS], 10); - #if M91x_USE_X + #if M91x_USE(X) if (hasNone || xval == 1 || (hasX && xval == 10)) tmc_clear_otpw(stepperX, TMC_X); #endif #if M91x_USE(X2) @@ -106,9 +102,9 @@ void GcodeSuite::M912() { #endif #endif - #if M91x_USE_Y || M91x_USE(Y2) + #if M91x_USE(Y) || M91x_USE(Y2) const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10); - #if M91x_USE_Y + #if M91x_USE(Y) if (hasNone || yval == 1 || (hasY && yval == 10)) tmc_clear_otpw(stepperY, TMC_Y); #endif #if M91x_USE(Y2) @@ -116,9 +112,9 @@ void GcodeSuite::M912() { #endif #endif - #if M91x_USE_Z || M91x_USE(Z2) + #if M91x_USE(Z) || M91x_USE(Z2) const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10); - #if M91x_USE_Z + #if M91x_USE(Z) if (hasNone || zval == 1 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ, TMC_Z); #endif #if M91x_USE(Z2) @@ -126,9 +122,9 @@ void GcodeSuite::M912() { #endif #endif - #if M91x_USE_E0 || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) + #if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10); - #if M91x_USE_E0 + #if M91x_USE_E(0) if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0); #endif #if M91x_USE_E(1) @@ -162,45 +158,45 @@ void GcodeSuite::M912() { report = false; switch (i) { case X_AXIS: - #if X_IS_TRINAMIC - if (index == 0) TMC_SET_PWMTHRS(X,X); + #if AXIS_HAS_STEALTHCHOP(X) + if (index < 2) TMC_SET_PWMTHRS(X,X); #endif - #if X2_IS_TRINAMIC - if (index == 1) TMC_SET_PWMTHRS(X,X2); + #if AXIS_HAS_STEALTHCHOP(X2) + if (!(index & 1)) TMC_SET_PWMTHRS(X,X2); #endif break; case Y_AXIS: - #if Y_IS_TRINAMIC - if (index == 0) TMC_SET_PWMTHRS(Y,Y); + #if AXIS_HAS_STEALTHCHOP(Y) + if (index < 2) TMC_SET_PWMTHRS(Y,Y); #endif - #if Y2_IS_TRINAMIC - if (index == 1) TMC_SET_PWMTHRS(Y,Y2); + #if AXIS_HAS_STEALTHCHOP(Y2) + if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2); #endif break; case Z_AXIS: - #if Z_IS_TRINAMIC - if (index == 0) TMC_SET_PWMTHRS(Z,Z); + #if AXIS_HAS_STEALTHCHOP(Z) + if (index < 2) TMC_SET_PWMTHRS(Z,Z); #endif - #if Z2_IS_TRINAMIC - if (index == 1) TMC_SET_PWMTHRS(Z,Z2); + #if AXIS_HAS_STEALTHCHOP(Z2) + if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2); #endif break; case E_AXIS: { if (get_target_extruder_from_command()) return; switch (target_extruder) { - #if E0_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E0) case 0: TMC_SET_PWMTHRS_E(0); break; #endif - #if E_STEPPERS > 1 && E1_IS_TRINAMIC + #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) case 1: TMC_SET_PWMTHRS_E(1); break; #endif - #if E_STEPPERS > 2 && E2_IS_TRINAMIC + #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) case 2: TMC_SET_PWMTHRS_E(2); break; #endif - #if E_STEPPERS > 3 && E3_IS_TRINAMIC + #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) case 3: TMC_SET_PWMTHRS_E(3); break; #endif - #if E_STEPPERS > 4 && E4_IS_TRINAMIC + #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) case 4: TMC_SET_PWMTHRS_E(4); break; #endif } @@ -208,48 +204,40 @@ void GcodeSuite::M912() { } } - if (report) LOOP_XYZE(i) switch (i) { - case X_AXIS: - #if X_IS_TRINAMIC - TMC_SAY_PWMTHRS(X,X); - #endif - #if X2_IS_TRINAMIC - TMC_SAY_PWMTHRS(X,X2); - #endif - break; - case Y_AXIS: - #if Y_IS_TRINAMIC - TMC_SAY_PWMTHRS(Y,Y); - #endif - #if Y2_IS_TRINAMIC - TMC_SAY_PWMTHRS(Y,Y2); - #endif - break; - case Z_AXIS: - #if Z_IS_TRINAMIC - TMC_SAY_PWMTHRS(Z,Z); - #endif - #if Z2_IS_TRINAMIC - TMC_SAY_PWMTHRS(Z,Z2); - #endif - break; - case E_AXIS: - #if E0_IS_TRINAMIC - TMC_SAY_PWMTHRS_E(0); - #endif - #if E_STEPPERS > 1 && E1_IS_TRINAMIC - TMC_SAY_PWMTHRS_E(1); - #endif - #if E_STEPPERS > 2 && E2_IS_TRINAMIC - TMC_SAY_PWMTHRS_E(2); - #endif - #if E_STEPPERS > 3 && E3_IS_TRINAMIC - TMC_SAY_PWMTHRS_E(3); - #endif - #if E_STEPPERS > 4 && E4_IS_TRINAMIC - TMC_SAY_PWMTHRS_E(4); - #endif - break; + if (report) { + #if AXIS_HAS_STEALTHCHOP(X) + TMC_SAY_PWMTHRS(X,X); + #endif + #if AXIS_HAS_STEALTHCHOP(X2) + TMC_SAY_PWMTHRS(X,X2); + #endif + #if AXIS_HAS_STEALTHCHOP(Y) + TMC_SAY_PWMTHRS(Y,Y); + #endif + #if AXIS_HAS_STEALTHCHOP(Y2) + TMC_SAY_PWMTHRS(Y,Y2); + #endif + #if AXIS_HAS_STEALTHCHOP(Z) + TMC_SAY_PWMTHRS(Z,Z); + #endif + #if AXIS_HAS_STEALTHCHOP(Z2) + TMC_SAY_PWMTHRS(Z,Z2); + #endif + #if AXIS_HAS_STEALTHCHOP(E0) + TMC_SAY_PWMTHRS_E(0); + #endif + #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) + TMC_SAY_PWMTHRS_E(1); + #endif + #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) + TMC_SAY_PWMTHRS_E(2); + #endif + #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) + TMC_SAY_PWMTHRS_E(3); + #endif + #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) + TMC_SAY_PWMTHRS_E(4); + #endif } } #endif // HYBRID_THRESHOLD @@ -268,58 +256,64 @@ void GcodeSuite::M912() { const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63); report = false; switch (i) { - case X_AXIS: - #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) - if (index == 0) TMC_SET_SGT(X); - #endif - #if ENABLED(X2_IS_TMC2130) - if (index == 1) TMC_SET_SGT(X2); - #endif - break; - case Y_AXIS: - #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) - if (index == 0) TMC_SET_SGT(Y); - #endif - #if ENABLED(Y2_IS_TMC2130) - if (index == 1) TMC_SET_SGT(Y2); - #endif - break; - case Z_AXIS: - #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) - if (index == 0) TMC_SET_SGT(Z); - #endif - #if ENABLED(Z2_IS_TMC2130) - if (index == 1) TMC_SET_SGT(Z2); - #endif - break; + #if X_SENSORLESS + case X_AXIS: + #if AXIS_HAS_STALLGUARD(X) + if (index < 2) TMC_SET_SGT(X); + #endif + #if AXIS_HAS_STALLGUARD(X2) + if (!(index & 1)) TMC_SET_SGT(X2); + #endif + break; + #endif + #if Y_SENSORLESS + case Y_AXIS: + #if AXIS_HAS_STALLGUARD(Y) + if (index < 2) TMC_SET_SGT(Y); + #endif + #if AXIS_HAS_STALLGUARD(Y2) + if (!(index & 1)) TMC_SET_SGT(Y2); + #endif + break; + #endif + #if Z_SENSORLESS + case Z_AXIS: + #if AXIS_HAS_STALLGUARD(Z) + if (index < 2) TMC_SET_SGT(Z); + #endif + #if AXIS_HAS_STALLGUARD(Z2) + if (!(index & 1)) TMC_SET_SGT(Z2); + #endif + break; + #endif } } - if (report) LOOP_XYZ(i) switch (i) { - case X_AXIS: - #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) + if (report) { + #if X_SENSORLESS + #if AXIS_HAS_STALLGUARD(X) TMC_SAY_SGT(X); #endif - #if ENABLED(X2_IS_TMC2130) + #if AXIS_HAS_STALLGUARD(X2) TMC_SAY_SGT(X2); #endif - break; - case Y_AXIS: - #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) + #endif + #if Y_SENSORLESS + #if AXIS_HAS_STALLGUARD(Y) TMC_SAY_SGT(Y); #endif - #if ENABLED(Y2_IS_TMC2130) + #if AXIS_HAS_STALLGUARD(Y2) TMC_SAY_SGT(Y2); #endif - break; - case Z_AXIS: - #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) + #endif + #if Z_SENSORLESS + #if AXIS_HAS_STALLGUARD(Z) TMC_SAY_SGT(Z); #endif - #if ENABLED(Z2_IS_TMC2130) + #if AXIS_HAS_STALLGUARD(Z2) TMC_SAY_SGT(Z2); #endif - break; + #endif } } #endif // SENSORLESS_HOMING @@ -337,11 +331,11 @@ void GcodeSuite::M912() { return; } - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) const uint16_t Z_current_1 = stepperZ.getCurrent(); stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) const uint16_t Z2_current_1 = stepperZ2.getCurrent(); stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); #endif @@ -352,10 +346,10 @@ void GcodeSuite::M912() { do_blocking_move_to_z(Z_MAX_POS+_z); - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER); #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 7e8d33a38f..4708e4cfe9 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -61,11 +61,6 @@ bool GcodeSuite::axis_relative_modes[] = AXIS_RELATIVE_MODES; float GcodeSuite::coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; #endif -#if HAS_LEVELING && ENABLED(G29_RETRY_AND_RECOVER) - #include "../feature/bedlevel/bedlevel.h" - #include "../module/planner.h" -#endif - /** * Set target_extruder from the T parameter or the active_extruder * @@ -108,7 +103,7 @@ void GcodeSuite::get_destination_from_command() { destination[i] = current_position[i]; } - if (parser.linearval('F') > 0.0) + if (parser.linearval('F') > 0) feedrate_mm_s = MMM_TO_MMS(parser.value_feedrate()); #if ENABLED(PRINTCOUNTER) @@ -136,34 +131,37 @@ void GcodeSuite::dwell(millis_t time) { */ #if HAS_LEVELING && ENABLED(G29_RETRY_AND_RECOVER) + #ifndef G29_MAX_RETRIES + #define G29_MAX_RETRIES 0 + #endif + void GcodeSuite::G29_with_retry() { - set_bed_leveling_enabled(false); - for (uint8_t i = G29_MAX_RETRIES; i--;) { - G29(); - if (planner.leveling_active) break; - #ifdef G29_ACTION_ON_RECOVER - SERIAL_ECHOLNPGM("//action:" G29_ACTION_ON_RECOVER); - #endif - #ifdef G29_RECOVER_COMMANDS - process_subcommands_now_P(PSTR(G29_RECOVER_COMMANDS)); - #endif - } - if (planner.leveling_active) { - #ifdef G29_SUCCESS_COMMANDS - process_subcommands_now_P(PSTR(G29_SUCCESS_COMMANDS)); - #endif - } - else { - #ifdef G29_FAILURE_COMMANDS - process_subcommands_now_P(PSTR(G29_FAILURE_COMMANDS)); - #endif - #ifdef G29_ACTION_ON_FAILURE - SERIAL_ECHOLNPGM("//action:" G29_ACTION_ON_FAILURE); - #endif - #if ENABLED(G29_HALT_ON_FAILURE) - kill(PSTR(MSG_ERR_PROBING_FAILED)); - #endif + uint8_t retries = G29_MAX_RETRIES; + while (G29()) { // G29 should return true for failed probes ONLY + if (retries--) { + #ifdef G29_ACTION_ON_RECOVER + SERIAL_ECHOLNPGM("//action:" G29_ACTION_ON_RECOVER); + #endif + #ifdef G29_RECOVER_COMMANDS + process_subcommands_now_P(PSTR(G29_RECOVER_COMMANDS)); + #endif + } + else { + #ifdef G29_FAILURE_COMMANDS + process_subcommands_now_P(PSTR(G29_FAILURE_COMMANDS)); + #endif + #ifdef G29_ACTION_ON_FAILURE + SERIAL_ECHOLNPGM("//action:" G29_ACTION_ON_FAILURE); + #endif + #if ENABLED(G29_HALT_ON_FAILURE) + kill(PSTR(MSG_ERR_PROBING_FAILED)); + #endif + return; + } } + #ifdef G29_SUCCESS_COMMANDS + process_subcommands_now_P(PSTR(G29_SUCCESS_COMMANDS)); + #endif } #endif // HAS_LEVELING && G29_RETRY_AND_RECOVER diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index a655e557d3..2130b1636e 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -132,7 +132,7 @@ * M119 - Report endstops status. * M120 - Enable endstops detection. * M121 - Disable endstops detection. - * M122 - Debug stepper (Requires HAVE_TMC2130 or HAVE_TMC2208) + * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) * M126 - Solenoid Air Valve Open. (Requires BARICUDA) * M127 - Solenoid Air Valve Closed. (Requires BARICUDA) @@ -219,13 +219,13 @@ * M868 - Report or set position encoder module error correction threshold. * M869 - Report position encoder module error. * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires HAVE_TMC2130 or HAVE_TMC2208) + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN) * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT) * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT) - * M911 - Report stepper driver overtemperature pre-warn condition. (Requires HAVE_TMC2130 or HAVE_TMC2208) - * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires HAVE_TMC2130 or HAVE_TMC2208) + * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) + * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD) * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING) * @@ -387,10 +387,13 @@ class GcodeSuite { static void G28(const bool always_home_all); #if HAS_LEVELING - static void G29(); #if ENABLED(G29_RETRY_AND_RECOVER) static void G29_with_retry(); + #define G29_TYPE bool + #else + #define G29_TYPE void #endif + static G29_TYPE G29(); #endif #if HAS_BED_PROBE diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 4c2c5ac913..09e920846c 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -35,7 +35,7 @@ #include "../../module/scara.h" #endif -#if ENABLED(SCARA_FEEDRATE_SCALING) && ENABLED(AUTO_BED_LEVELING_BILINEAR) +#if HAS_FEEDRATE_SCALING && ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "../../feature/bedlevel/abl/abl.h" #endif @@ -92,7 +92,7 @@ void plan_arc( const float flat_mm = radius * angular_travel, mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm); - if (mm_of_travel < 0.001) return; + if (mm_of_travel < 0.001f) return; uint16_t segments = FLOOR(mm_of_travel / (MM_PER_ARC_SEGMENT)); if (segments == 0) segments = 1; @@ -129,7 +129,7 @@ void plan_arc( linear_per_segment = linear_travel / segments, extruder_per_segment = extruder_travel / segments, sin_T = theta_per_segment, - cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation + cos_T = 1 - 0.5f * sq(theta_per_segment); // Small angle approximation // Initialize the linear axis raw[l_axis] = current_position[l_axis]; @@ -141,12 +141,16 @@ void plan_arc( millis_t next_idle_ms = millis() + 200UL; - #if ENABLED(SCARA_FEEDRATE_SCALING) + #if HAS_FEEDRATE_SCALING // SCARA needs to scale the feed rate from mm/s to degrees/s - const float inv_segment_length = 1.0 / (MM_PER_ARC_SEGMENT), + const float inv_segment_length = 1.0f / float(MM_PER_ARC_SEGMENT), inverse_secs = inv_segment_length * fr_mm_s; float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS]; + oldB = planner.position_float[B_AXIS] + #if ENABLED(DELTA_FEEDRATE_SCALING) + , oldC = planner.position_float[C_AXIS] + #endif + ; #endif #if N_ARC_CORRECTION > 1 @@ -192,14 +196,23 @@ void plan_arc( clamp_to_software_endstops(raw); + #if HAS_FEEDRATE_SCALING + inverse_kinematics(raw); + ADJUST_DELTA(raw); + #endif + #if ENABLED(SCARA_FEEDRATE_SCALING) // For SCARA scale the feed rate from mm/s to degrees/s // i.e., Complete the angular vector in the given time. - inverse_kinematics(raw); - ADJUST_DELTA(raw); if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder)) break; oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; + #elif ENABLED(DELTA_FEEDRATE_SCALING) + // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s + // i.e., Complete the linear vector in the given time. + if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder)) + break; + oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; #elif HAS_UBL_AND_CURVES float pos[XYZ] = { raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS] }; planner.apply_leveling(pos); @@ -212,12 +225,19 @@ void plan_arc( } // Ensure last segment arrives at target location. - #if ENABLED(SCARA_FEEDRATE_SCALING) + #if HAS_FEEDRATE_SCALING inverse_kinematics(cart); ADJUST_DELTA(cart); + #endif + + #if ENABLED(SCARA_FEEDRATE_SCALING) const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); if (diff2) planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], cart[Z_AXIS], cart[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); + #elif ENABLED(DELTA_FEEDRATE_SCALING) + const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); + if (diff2) + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); #elif HAS_UBL_AND_CURVES float pos[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; planner.apply_leveling(pos); @@ -269,19 +289,20 @@ void GcodeSuite::G2_G3(const bool clockwise) { relative_mode = relative_mode_backup; #endif - float arc_offset[2] = { 0.0, 0.0 }; + float arc_offset[2] = { 0, 0 }; if (parser.seenval('R')) { const float r = parser.value_linear_units(), p1 = current_position[X_AXIS], q1 = current_position[Y_AXIS], p2 = destination[X_AXIS], q2 = destination[Y_AXIS]; if (r && (p2 != p1 || q2 != q1)) { - const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 - dx = p2 - p1, dy = q2 - q1, // X and Y differences - d = HYPOT(dx, dy), // Linear distance between the points - h = SQRT(sq(r) - sq(d * 0.5)), // Distance to the arc pivot-point - mx = (p1 + p2) * 0.5, my = (q1 + q2) * 0.5, // Point between the two points - sx = -dy / d, sy = dx / d, // Slope of the perpendicular bisector - cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc + const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 + dx = p2 - p1, dy = q2 - q1, // X and Y differences + d = HYPOT(dx, dy), // Linear distance between the points + dinv = 1/d, // Inverse of d + h = SQRT(sq(r) - sq(d * 0.5f)), // Distance to the arc pivot-point + mx = (p1 + p2) * 0.5f, my = (q1 + q2) * 0.5f,// Point between the two points + sx = -dy * dinv, sy = dx * dinv, // Slope of the perpendicular bisector + cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc arc_offset[0] = cx - p1; arc_offset[1] = cy - q1; } diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index e355856709..82843d6226 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -85,7 +85,7 @@ class GCodeParser { #endif #if ENABLED(DEBUG_GCODE_PARSER) - void debug(); + static void debug(); #endif // Reset is done before parsing @@ -186,15 +186,15 @@ class GCodeParser { if (c == '\0' || c == ' ') break; if (c == 'E' || c == 'e') { *e = '\0'; - const float ret = strtod(value_ptr, NULL); + const float ret = strtof(value_ptr, NULL); *e = c; return ret; } ++e; } - return strtod(value_ptr, NULL); + return strtof(value_ptr, NULL); } - return 0.0; + return 0; } // Code value as a long or ulong @@ -203,7 +203,7 @@ class GCodeParser { // Code value for use as time FORCE_INLINE static millis_t value_millis() { return value_ulong(); } - FORCE_INLINE static millis_t value_millis_from_seconds() { return value_float() * 1000UL; } + FORCE_INLINE static millis_t value_millis_from_seconds() { return (millis_t)(value_float() * 1000); } // Reduce to fewer bits FORCE_INLINE static int16_t value_int() { return (int16_t)value_long(); } @@ -217,17 +217,20 @@ class GCodeParser { #if ENABLED(INCH_MODE_SUPPORT) + // Init linear units by constructor + GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } + inline static void set_input_linear_units(const LinearUnit units) { switch (units) { case LINEARUNIT_INCH: - linear_unit_factor = 25.4; + linear_unit_factor = 25.4f; break; case LINEARUNIT_MM: default: - linear_unit_factor = 1.0; + linear_unit_factor = 1; break; } - volumetric_unit_factor = POW(linear_unit_factor, 3.0); + volumetric_unit_factor = POW(linear_unit_factor, 3); } inline static float axis_unit_factor(const AxisEnum axis) { @@ -261,9 +264,9 @@ class GCodeParser { inline static float to_temp_units(const float &f) { switch (input_temp_units) { case TEMPUNIT_F: - return f * 0.5555555556 + 32.0; + return f * 0.5555555556f + 32; case TEMPUNIT_K: - return f + 273.15; + return f + 273.15f; case TEMPUNIT_C: default: return f; @@ -276,9 +279,9 @@ class GCodeParser { const float f = value_float(); switch (input_temp_units) { case TEMPUNIT_F: - return (f - 32.0) * 0.5555555556; + return (f - 32) * 0.5555555556f; case TEMPUNIT_K: - return f - 273.15; + return f - 273.15f; case TEMPUNIT_C: default: return f; @@ -288,7 +291,7 @@ class GCodeParser { inline static float value_celsius_diff() { switch (input_temp_units) { case TEMPUNIT_F: - return value_float() * 0.5555555556; + return value_float() * 0.5555555556f; case TEMPUNIT_C: case TEMPUNIT_K: default: @@ -315,8 +318,8 @@ class GCodeParser { FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } FORCE_INLINE static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } FORCE_INLINE static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } - FORCE_INLINE static float linearval(const char c, const float dval=0.0) { return seenval(c) ? value_linear_units() : dval; } - FORCE_INLINE static float celsiusval(const char c, const float dval=0.0) { return seenval(c) ? value_celsius() : dval; } + FORCE_INLINE static float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } + FORCE_INLINE static float celsiusval(const char c, const float dval=0){ return seenval(c) ? value_celsius() : dval; } }; diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 7e92579eed..9bf161e200 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -496,7 +496,7 @@ inline void get_serial_commands() { if (job_recovery_commands_count) { if (_enqueuecommand(job_recovery_commands[job_recovery_commands_index])) { ++job_recovery_commands_index; - if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_IDLE; + if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_DONE; } return true; } diff --git a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp index 85b352bb0e..6a982b74b0 100644 --- a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp +++ b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp @@ -72,6 +72,9 @@ void GcodeSuite::M22() { card.release(); } * M23: Open a file */ void GcodeSuite::M23() { + #if ENABLED(POWER_LOSS_RECOVERY) + card.removeJobRecoveryFile(); + #endif // Simplify3D includes the size, so zero out all spaces (#7227) for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; card.openFile(parser.string_arg, true); @@ -81,16 +84,22 @@ void GcodeSuite::M23() { * M24: Start or Resume SD Print */ void GcodeSuite::M24() { - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - #if ENABLED(PARK_HEAD_ON_PAUSE) resume_print(); #endif + #if ENABLED(POWER_LOSS_RECOVERY) + if (parser.seenval('S')) card.setIndex(parser.value_long()); + #endif + card.startFileprint(); - print_job_timer.start(); + + #if ENABLED(POWER_LOSS_RECOVERY) + if (parser.seenval('T')) + print_job_timer.resume(parser.value_long()); + else + #endif + print_job_timer.start(); } /** diff --git a/Marlin/src/gcode/temperature/M104_M109.cpp b/Marlin/src/gcode/temperature/M104_M109.cpp index 8cc02401ac..61099aa208 100644 --- a/Marlin/src/gcode/temperature/M104_M109.cpp +++ b/Marlin/src/gcode/temperature/M104_M109.cpp @@ -225,7 +225,7 @@ void GcodeSuite::M109() { // break after MIN_COOLING_SLOPE_TIME seconds // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < MIN_COOLING_SLOPE_DEG) break; + if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break; next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME; old_temp = temp; } diff --git a/Marlin/src/gcode/temperature/M140_M190.cpp b/Marlin/src/gcode/temperature/M140_M190.cpp index 324a1b9f93..c51c643288 100644 --- a/Marlin/src/gcode/temperature/M140_M190.cpp +++ b/Marlin/src/gcode/temperature/M140_M190.cpp @@ -82,7 +82,7 @@ void GcodeSuite::M190() { #define TEMP_BED_CONDITIONS (wants_to_cool ? thermalManager.isCoolingBed() : thermalManager.isHeatingBed()) #endif - float target_temp = -1.0, old_temp = 9999.0; + float target_temp = -1, old_temp = 9999; bool wants_to_cool = false; wait_for_heatup = true; millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; @@ -163,7 +163,7 @@ void GcodeSuite::M190() { // Break after MIN_COOLING_SLOPE_TIME_BED seconds // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break; + if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_BED)) break; next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED; old_temp = temp; } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 0abd45135e..608225ca4f 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -201,6 +201,18 @@ #endif #endif +/** + * SPI PANELS + */ + + // Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h + #if ENABLED(U8GLIB_SH1106_EINSTART) + #define ULTRA_LCD + #define DOGLCD + #define ULTIPANEL + #define NEWPANEL + #endif + /** * I2C PANELS */ @@ -390,12 +402,6 @@ #define HAS_DEBUG_MENU (ENABLED(ULTIPANEL) && ENABLED(LCD_PROGRESS_BAR_TEST)) -// MK2 Multiplexer forces SINGLENOZZLE and kills DISABLE_INACTIVE_EXTRUDER -#if ENABLED(MK2_MULTIPLEXER) - #define SINGLENOZZLE - #undef DISABLE_INACTIVE_EXTRUDER -#endif - /** * Extruders have some combination of stepper motors and hotends * so we separate these concepts into the defines: @@ -406,8 +412,6 @@ * E_MANUAL - Number of E steppers for LCD move options * */ -#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) - #if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS #if EXTRUDERS > 4 #define E_STEPPERS 3 @@ -428,6 +432,16 @@ #define E_MANUAL EXTRUDERS #endif +// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE +#if ENABLED(MK2_MULTIPLEXER) || ENABLED(SWITCHING_NOZZLE) + #undef DISABLE_INACTIVE_EXTRUDER +#endif + +// MK2 Multiplexer forces SINGLENOZZLE +#if ENABLED(MK2_MULTIPLEXER) + #define SINGLENOZZLE +#endif + #if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset #undef HOTENDS #define HOTENDS 1 @@ -440,6 +454,8 @@ #define HOTENDS EXTRUDERS #endif +#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) + #define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)) /** @@ -504,7 +520,7 @@ * Set flags for enabled probes */ #define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) -#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY)) +#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) #if !HAS_BED_PROBE // Clear probe pin settings when no probe is selected diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 403d4202fb..9ba0b5db28 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -85,6 +85,18 @@ #define Y_MIN_BED (Y_CENTER - (Y_BED_SIZE) / 2) #define Y_MAX_BED (Y_CENTER + (Y_BED_SIZE) / 2) +/** + * Dual X Carriage + */ +#if ENABLED(DUAL_X_CARRIAGE) + #ifndef X1_MIN_POS + #define X1_MIN_POS X_MIN_POS + #endif + #ifndef X1_MAX_POS + #define X1_MAX_POS X_BED_SIZE + #endif +#endif + /** * CoreXY, CoreXZ, and CoreYZ - and their reverse */ @@ -426,6 +438,63 @@ #define ARRAY_BY_HOTENDS(...) ARRAY_N(HOTENDS, __VA_ARGS__) #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) +/** + * Driver Timings + * NOTE: Driver timing order is longest-to-shortest duration. + * Preserve this ordering when adding new drivers. + */ +#ifndef MINIMUM_STEPPER_DIR_DELAY + #if HAS_DRIVER(TB6560) + #define MINIMUM_STEPPER_DIR_DELAY 15000 + #elif HAS_DRIVER(TB6600) + #define MINIMUM_STEPPER_DIR_DELAY 1500 + #elif HAS_DRIVER(DRV8825) + #define MINIMUM_STEPPER_DIR_DELAY 650 + #elif HAS_DRIVER(LV8729) + #define MINIMUM_STEPPER_DIR_DELAY 500 + #elif HAS_DRIVER(A4988) + #define MINIMUM_STEPPER_DIR_DELAY 200 + #elif HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) + #define MINIMUM_STEPPER_DIR_DELAY 20 + #else + #define MINIMUM_STEPPER_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire + #endif +#endif + +#ifndef MINIMUM_STEPPER_PULSE + #if HAS_DRIVER(TB6560) + #define MINIMUM_STEPPER_PULSE 30 + #elif HAS_DRIVER(TB6600) + #define MINIMUM_STEPPER_PULSE 3 + #elif HAS_DRIVER(DRV8825) + #define MINIMUM_STEPPER_PULSE 2 + #elif HAS_DRIVER(A4988) || HAS_DRIVER(LV8729) + #define MINIMUM_STEPPER_PULSE 1 + #elif HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) + #define MINIMUM_STEPPER_PULSE 0 + #else + #define MINIMUM_STEPPER_PULSE 2 + #endif +#endif + +#ifndef MAXIMUM_STEPPER_RATE + #if HAS_DRIVER(TB6560) + #define MAXIMUM_STEPPER_RATE 15000 + #elif HAS_DRIVER(LV8729) + #define MAXIMUM_STEPPER_RATE 130000 + #elif HAS_DRIVER(TB6600) + #define MAXIMUM_STEPPER_RATE 150000 + #elif HAS_DRIVER(DRV8825) + #define MAXIMUM_STEPPER_RATE 250000 + #elif HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) + #define MAXIMUM_STEPPER_RATE 400000 + #elif HAS_DRIVER(A4988) + #define MAXIMUM_STEPPER_RATE 500000 + #else + #define MAXIMUM_STEPPER_RATE 250000 + #endif +#endif + /** * X_DUAL_ENDSTOPS endstop reassignment */ @@ -657,24 +726,27 @@ #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) #define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) #define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) -#define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) +#define HAS_X2_MICROSTEPS (PIN_EXISTS(X2_MS1)) #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) #define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) #define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) -#define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) +#define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) +#define HAS_Y2_MICROSTEPS (PIN_EXISTS(Y2_MS1)) #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) #define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) #define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) +#define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) +#define HAS_Z2_MICROSTEPS (PIN_EXISTS(Z2_MS1)) // Extruder steppers and solenoids #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) @@ -708,27 +780,19 @@ #define HAS_SOLENOID_4 (PIN_EXISTS(SOL4)) // Trinamic Stepper Drivers -#define HAS_TRINAMIC (ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) || ENABLED(IS_TRAMS)) -#define X_IS_TRINAMIC (ENABLED( X_IS_TMC2130) || ENABLED( X_IS_TMC2208) || ENABLED(IS_TRAMS)) -#define X2_IS_TRINAMIC (ENABLED(X2_IS_TMC2130) || ENABLED(X2_IS_TMC2208)) -#define Y_IS_TRINAMIC (ENABLED( Y_IS_TMC2130) || ENABLED( Y_IS_TMC2208) || ENABLED(IS_TRAMS)) -#define Y2_IS_TRINAMIC (ENABLED(Y2_IS_TMC2130) || ENABLED(Y2_IS_TMC2208)) -#define Z_IS_TRINAMIC (ENABLED( Z_IS_TMC2130) || ENABLED( Z_IS_TMC2208) || ENABLED(IS_TRAMS)) -#define Z2_IS_TRINAMIC (ENABLED(Z2_IS_TMC2130) || ENABLED(Z2_IS_TMC2208)) -#define E0_IS_TRINAMIC (ENABLED(E0_IS_TMC2130) || ENABLED(E0_IS_TMC2208) || ENABLED(IS_TRAMS)) -#define E1_IS_TRINAMIC (ENABLED(E1_IS_TMC2130) || ENABLED(E1_IS_TMC2208)) -#define E2_IS_TRINAMIC (ENABLED(E2_IS_TMC2130) || ENABLED(E2_IS_TMC2208)) -#define E3_IS_TRINAMIC (ENABLED(E3_IS_TMC2130) || ENABLED(E3_IS_TMC2208)) -#define E4_IS_TRINAMIC (ENABLED(E4_IS_TMC2130) || ENABLED(E4_IS_TMC2208)) +#define HAS_STEALTHCHOP (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208)) +#define HAS_STALLGUARD (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2660)) +#define AXIS_HAS_STEALTHCHOP(ST) ( AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2208) ) +#define AXIS_HAS_STALLGUARD(ST) ( AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2660) ) #if ENABLED(SENSORLESS_HOMING) // Disable Z axis sensorless homing if a probe is used to home the Z axis #if HOMING_Z_WITH_PROBE #undef Z_HOMING_SENSITIVITY #endif - #define X_SENSORLESS (ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY)) - #define Y_SENSORLESS (ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY)) - #define Z_SENSORLESS (ENABLED(Z_IS_TMC2130) && defined(Z_HOMING_SENSITIVITY)) + #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_HOMING_SENSITIVITY)) + #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_HOMING_SENSITIVITY)) + #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_HOMING_SENSITIVITY)) #endif // Endstops and bed probe @@ -1050,6 +1114,7 @@ #define PLANNER_LEVELING (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_SEGMENTED || ENABLED(SKEW_CORRECTION)) #define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) #define HAS_UBL_AND_CURVES (ENABLED(AUTO_BED_LEVELING_UBL) && !PLANNER_LEVELING && (ENABLED(ARC_SUPPORT) || ENABLED(BEZIER_CURVE_SUPPORT))) +#define HAS_FEEDRATE_SCALING (ENABLED(SCARA_FEEDRATE_SCALING) || ENABLED(DELTA_FEEDRATE_SCALING)) #if ENABLED(AUTO_BED_LEVELING_UBL) #undef LCD_BED_LEVELING @@ -1304,13 +1369,19 @@ #define Z_HOMING_HEIGHT Z_CLEARANCE_BETWEEN_PROBES #endif #endif -#ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT -#endif -#if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT - #define MANUAL_PROBE_HEIGHT Z_CLEARANCE_BETWEEN_PROBES -#else - #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT + +#if PROBE_SELECTED + #ifndef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT + #endif + #if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT + #define MANUAL_PROBE_HEIGHT Z_CLEARANCE_BETWEEN_PROBES + #else + #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT + #endif + #ifndef Z_CLEARANCE_MULTI_PROBE + #define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES + #endif #endif #ifndef __SAM3X8E__ //todo: hal: broken hal encapsulation @@ -1349,25 +1420,6 @@ #endif #endif -// Use float instead of double. Needs profiling. -#if defined(ARDUINO_ARCH_SAM) && ENABLED(DELTA_FAST_SQRT) - #undef ATAN2 - #undef FABS - #undef POW - #undef SQRT - #undef CEIL - #undef FLOOR - #undef LROUND - #undef FMOD - #define ATAN2(y, x) atan2f(y, x) - #define POW(x, y) powf(x, y) - #define SQRT(x) sqrtf(x) - #define CEIL(x) ceilf(x) - #define FLOOR(x) floorf(x) - #define LROUND(x) lroundf(x) - #define FMOD(x, y) fmodf(x, y) -#endif - // Number of VFAT entries used. Each entry has 13 UTF-16 characters #if ENABLED(SCROLL_LONG_FILENAMES) #define MAX_VFAT_ENTRIES (5) diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index 9ed1ee8ffa..7f9b50eb01 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -30,6 +30,7 @@ #include "Version.h" #include "../../Configuration.h" #include "Conditionals_LCD.h" +#include "../core/drivers.h" #include "../../Configuration_adv.h" #include "Conditionals_adv.h" diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 4b75ddfae8..2dcac8015d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -265,10 +265,28 @@ #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration." #elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now HAVE_TMC26X. Please update your Configuration_adv.h." + #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." +#elif defined(HAVE_TMC26X) + #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." +#elif defined(HAVE_TMC2130) + #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." +#elif defined(HAVE_L6470DRIVER) + #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." #elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) \ || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_IS_TMC26X. Please update your Configuration_adv.h." + #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." +#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) \ + || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) + #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." +#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) \ + || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) + #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." +#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) \ + || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) + #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." +#elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) \ + || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) + #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." #elif defined(AUTOMATIC_CURRENT_CONTROL) #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." #elif defined(FILAMENT_CHANGE_LOAD_LENGTH) @@ -293,10 +311,13 @@ #define BOARD_MKS_13 -47 #define BOARD_TRIGORILLA -343 +#define BOARD_RURAMPS4D -1550 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." #elif MB(BOARD_TRIGORILLA) #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration." +#elif MB(BOARD_RURAMPS4D) + #error "BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11. Please update your configuration." #endif /** @@ -823,6 +844,9 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "Z_PROBE_LOW_POINT must be less than or equal to 0." #endif + static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); + static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); + #else /** @@ -936,6 +960,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." #endif +#if ENABLED(G29_RETRY_AND_RECOVER) && HAS_LEVELING && !OLDSCHOOL_ABL + #error "G29_RETRY_AND_RECOVER currently only supports ABL" +#endif + /** * LCD_BED_LEVELING requirements */ @@ -967,15 +995,11 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, */ #if ENABLED(Z_SAFE_HOMING) #if HAS_BED_PROBE - static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), - "Z_SAFE_HOMING_X_POINT is outside the probe region."); - static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), - "Z_SAFE_HOMING_Y_POINT is outside the probe region."); + static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region."); + static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region."); #else - static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), - "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle."); - static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), - "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."); + static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle."); + static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."); #endif #endif // Z_SAFE_HOMING @@ -1451,122 +1475,36 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif /** - * Make sure HAVE_TMC26X is warranted - */ -#if ENABLED(HAVE_TMC26X) && !( \ - ENABLED( X_IS_TMC26X ) \ - || ENABLED( X2_IS_TMC26X ) \ - || ENABLED( Y_IS_TMC26X ) \ - || ENABLED( Y2_IS_TMC26X ) \ - || ENABLED( Z_IS_TMC26X ) \ - || ENABLED( Z2_IS_TMC26X ) \ - || ENABLED( E0_IS_TMC26X ) \ - || ENABLED( E1_IS_TMC26X ) \ - || ENABLED( E2_IS_TMC26X ) \ - || ENABLED( E3_IS_TMC26X ) \ - || ENABLED( E4_IS_TMC26X ) \ - ) - #error "HAVE_TMC26X requires at least one TMC26X stepper to be set." -#endif - -/** - * Make sure HAVE_TMC2130 is warranted - */ -#if ENABLED(HAVE_TMC2130) - #if !( ENABLED( X_IS_TMC2130 ) \ - || ENABLED( X2_IS_TMC2130 ) \ - || ENABLED( Y_IS_TMC2130 ) \ - || ENABLED( Y2_IS_TMC2130 ) \ - || ENABLED( Z_IS_TMC2130 ) \ - || ENABLED( Z2_IS_TMC2130 ) \ - || ENABLED( E0_IS_TMC2130 ) \ - || ENABLED( E1_IS_TMC2130 ) \ - || ENABLED( E2_IS_TMC2130 ) \ - || ENABLED( E3_IS_TMC2130 ) \ - || ENABLED( E4_IS_TMC2130 ) ) - #error "HAVE_TMC2130 requires at least one TMC2130 stepper to be set." - #elif ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) - #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." - #endif - - #if ENABLED(X_IS_TMC2130) && !PIN_EXISTS(X_CS) - #error "X_CS_PIN is required for X_IS_TMC2130. Define X_CS_PIN in Configuration_adv.h." - #elif ENABLED(X2_IS_TMC2130) && !PIN_EXISTS(X2_CS) - #error "X2_CS_PIN is required for X2_IS_TMC2130. Define X2_CS_PIN in Configuration_adv.h." - #elif ENABLED(Y_IS_TMC2130) && !PIN_EXISTS(Y_CS) - #error "Y_CS_PIN is required for Y_IS_TMC2130. Define Y_CS_PIN in Configuration_adv.h." - #elif ENABLED(Y2_IS_TMC2130) && !PIN_EXISTS(Y2_CS) - #error "Y2_CS_PIN is required for Y2_IS_TMC2130. Define Y2_CS_PIN in Configuration_adv.h." - #elif ENABLED(Z_IS_TMC2130) && !PIN_EXISTS(Z_CS) - #error "Z_CS_PIN is required for Z_IS_TMC2130. Define Z_CS_PIN in Configuration_adv.h." - #elif ENABLED(Z2_IS_TMC2130) && !PIN_EXISTS(Z2_CS) - #error "Z2_CS_PIN is required for Z2_IS_TMC2130. Define Z2_CS_PIN in Configuration_adv.h." - #elif ENABLED(E0_IS_TMC2130) && !PIN_EXISTS(E0_CS) - #error "E0_CS_PIN is required for E0_IS_TMC2130. Define E0_CS_PIN in Configuration_adv.h." - #elif ENABLED(E1_IS_TMC2130) && !PIN_EXISTS(E1_CS) - #error "E1_CS_PIN is required for E1_IS_TMC2130. Define E1_CS_PIN in Configuration_adv.h." - #elif ENABLED(E2_IS_TMC2130) && !PIN_EXISTS(E2_CS) - #error "E2_CS_PIN is required for E2_IS_TMC2130. Define E2_CS_PIN in Configuration_adv.h." - #elif ENABLED(E3_IS_TMC2130) && !PIN_EXISTS(E3_CS) - #error "E3_CS_PIN is required for E3_IS_TMC2130. Define E3_CS_PIN in Configuration_adv.h." - #elif ENABLED(E4_IS_TMC2130) && !PIN_EXISTS(E4_CS) - #error "E4_CS_PIN is required for E4_IS_TMC2130. Define E4_CS_PIN in Configuration_adv.h." - #endif - - #if ENABLED(SENSORLESS_HOMING) - // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop - // is necessary in order to reset the stallGuard indication between the initial movement of all three - // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of - // clearing the stallGuard activated status is found. - #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP) - #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP." - #elif X_HOME_DIR == -1 && DISABLED(X_MIN_ENDSTOP_INVERTING) - #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING when homing to X_MIN." - #elif X_HOME_DIR == 1 && DISABLED(X_MAX_ENDSTOP_INVERTING) - #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING when homing to X_MAX." - #elif Y_HOME_DIR == -1 && DISABLED(Y_MIN_ENDSTOP_INVERTING) - #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING when homing to Y_MIN." - #elif Y_HOME_DIR == 1 && DISABLED(Y_MAX_ENDSTOP_INVERTING) - #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING when homing to Y_MAX." - #endif - #endif - - // Sensorless homing is required for both combined steppers in an H-bot - #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS - #error "CoreXY requires both X and Y to use sensorless homing if either does." - #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS - #error "CoreXZ requires both X and Z to use sensorless homing if either does." - #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS - #error "CoreYZ requires both Y and Z to use sensorless homing if either does." - #endif - -#elif ENABLED(SENSORLESS_HOMING) - - #error "SENSORLESS_HOMING requires TMC2130 stepper drivers." - -#endif - -/** - * Make sure HAVE_TMC2208 is warranted + * Check existing CS pins against enabled TMC SPI drivers. */ -#if ENABLED(HAVE_TMC2208) && !( \ - ENABLED( X_IS_TMC2208 ) \ - || ENABLED( X2_IS_TMC2208 ) \ - || ENABLED( Y_IS_TMC2208 ) \ - || ENABLED( Y2_IS_TMC2208 ) \ - || ENABLED( Z_IS_TMC2208 ) \ - || ENABLED( Z2_IS_TMC2208 ) \ - || ENABLED( E0_IS_TMC2208 ) \ - || ENABLED( E1_IS_TMC2208 ) \ - || ENABLED( E2_IS_TMC2208 ) \ - || ENABLED( E3_IS_TMC2208 ) ) - #error "HAVE_TMC2208 requires at least one TMC2208 stepper to be set." +#if AXIS_DRIVER_TYPE(X, TMC2130) && !PIN_EXISTS(X_CS) + #error "X_CS_PIN is required for TMC2130. Define X_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(X2, TMC2130) && !PIN_EXISTS(X2_CS) + #error "X2_CS_PIN is required for X2. Define X2_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(Y, TMC2130) && !PIN_EXISTS(Y_CS) + #error "Y_CS_PIN is required for TMC2130. Define Y_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(Y2, TMC2130) && !PIN_EXISTS(Y2_CS) + #error "Y2_CS_PIN is required for TMC2130. Define Y2_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(Z, TMC2130) && !PIN_EXISTS(Z_CS) + #error "Z_CS_PIN is required for TMC2130. Define Z_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(Z2, TMC2130) && !PIN_EXISTS(Z2_CS) + #error "Z2_CS_PIN is required for TMC2130. Define Z2_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(E0, TMC2130) && !PIN_EXISTS(E0_CS) + #error "E0_CS_PIN is required for TMC2130. Define E0_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(E1, TMC2130) && !PIN_EXISTS(E1_CS) + #error "E1_CS_PIN is required for TMC2130. Define E1_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(E2, TMC2130) && !PIN_EXISTS(E2_CS) + #error "E2_CS_PIN is required for TMC2130. Define E2_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(E3, TMC2130) && !PIN_EXISTS(E3_CS) + #error "E3_CS_PIN is required for TMC2130. Define E3_CS_PIN in Configuration_adv.h." +#elif AXIS_DRIVER_TYPE(E4, TMC2130) && !PIN_EXISTS(E4_CS) + #error "E4_CS_PIN is required for TMC2130. Define E4_CS_PIN in Configuration_adv.h." #endif /** * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) */ -#if ENABLED(HAVE_TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \ +#if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \ defined(X_HARDWARE_SERIAL ) \ || defined(X2_HARDWARE_SERIAL) \ || defined(Y_HARDWARE_SERIAL ) \ @@ -1581,113 +1519,52 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE." #endif -#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) - #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." +#if ENABLED(SENSORLESS_HOMING) + // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop + // is necessary in order to reset the stallGuard indication between the initial movement of all three + // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of + // clearing the stallGuard activated status is found. + #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP) + #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP." + #elif X_SENSORLESS && X_HOME_DIR == -1 && (DISABLED(X_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMIN)) + #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN." + #elif X_SENSORLESS && X_HOME_DIR == 1 && (DISABLED(X_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMAX)) + #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX." + #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (DISABLED(Y_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMIN)) + #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN." + #elif Y_SENSORLESS && Y_HOME_DIR == 1 && (DISABLED(Y_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMAX)) + #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX." + #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (DISABLED(Z_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMIN)) + #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN." + #elif Z_SENSORLESS && Z_HOME_DIR == 1 && (DISABLED(Z_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMAX)) + #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX." + #elif ENABLED(ENDSTOP_NOISE_FILTER) + #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_FILTER." + #endif #endif -#if ENABLED(TMC_Z_CALIBRATION) && !Z_IS_TRINAMIC && !Z2_IS_TRINAMIC - #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis" +// Sensorless homing is required for both combined steppers in an H-bot +#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS + #error "CoreXY requires both X and Y to use sensorless homing if either does." +#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS + #error "CoreXZ requires both X and Z to use sensorless homing if either does." +#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS + #error "CoreYZ requires both Y and Z to use sensorless homing if either does." #endif -/** - * Make sure HAVE_L6470DRIVER is warranted - */ -#if ENABLED(HAVE_L6470DRIVER) && !( \ - ENABLED( X_IS_L6470 ) \ - || ENABLED( X2_IS_L6470 ) \ - || ENABLED( Y_IS_L6470 ) \ - || ENABLED( Y2_IS_L6470 ) \ - || ENABLED( Z_IS_L6470 ) \ - || ENABLED( Z2_IS_L6470 ) \ - || ENABLED( E0_IS_L6470 ) \ - || ENABLED( E1_IS_L6470 ) \ - || ENABLED( E2_IS_L6470 ) \ - || ENABLED( E3_IS_L6470 ) \ - || ENABLED( E4_IS_L6470 ) \ - ) - #error "HAVE_L6470DRIVER requires at least one L6470 stepper to be set." -#endif - -/** - * Check that each axis has only one driver selected - */ -#if 1 < 0 \ - + ENABLED(X_IS_TMC26X) \ - + ENABLED(X_IS_TMC2130) \ - + ENABLED(X_IS_TMC2208) \ - + ENABLED(X_IS_L6470) - #error "Please enable only one stepper driver for the X axis." -#endif -#if 1 < 0 \ - + ENABLED(X2_IS_TMC26X) \ - + ENABLED(X2_IS_TMC2130) \ - + ENABLED(X2_IS_TMC2208) \ - + ENABLED(X2_IS_L6470) - #error "Please enable only one stepper driver for the X2 axis." -#endif -#if 1 < 0 \ - + ENABLED(Y_IS_TMC26X) \ - + ENABLED(Y_IS_TMC2130) \ - + ENABLED(Y_IS_TMC2208) \ - + ENABLED(Y_IS_L6470) - #error "Please enable only one stepper driver for the Y axis." -#endif -#if 1 < 0 \ - + ENABLED(Y2_IS_TMC26X) \ - + ENABLED(Y2_IS_TMC2130) \ - + ENABLED(Y2_IS_TMC2208) \ - + ENABLED(Y2_IS_L6470) - #error "Please enable only one stepper driver for the Y2 axis." -#endif -#if 1 < 0 \ - + ENABLED(Z_IS_TMC26X) \ - + ENABLED(Z_IS_TMC2130) \ - + ENABLED(Z_IS_TMC2208) \ - + ENABLED(Z_IS_L6470) - #error "Please enable only one stepper driver for the Z axis." -#endif -#if 1 < 0 \ - + ENABLED(Z2_IS_TMC26X) \ - + ENABLED(Z2_IS_TMC2130) \ - + ENABLED(Z2_IS_TMC2208) \ - + ENABLED(Z2_IS_L6470) - #error "Please enable only one stepper driver for the Z2 axis." -#endif -#if 1 < 0 \ - + ENABLED(E0_IS_TMC26X) \ - + ENABLED(E0_IS_TMC2130) \ - + ENABLED(E0_IS_TMC2208) \ - + ENABLED(E0_IS_L6470) - #error "Please enable only one stepper driver for the E0 axis." -#endif -#if 1 < 0 \ - + ENABLED(E1_IS_TMC26X) \ - + ENABLED(E1_IS_TMC2130) \ - + ENABLED(E1_IS_TMC2208) \ - + ENABLED(E1_IS_L6470) - #error "Please enable only one stepper driver for the E1 axis." -#endif -#if 1 < 0 \ - + ENABLED(E2_IS_TMC26X) \ - + ENABLED(E2_IS_TMC2130) \ - + ENABLED(E2_IS_TMC2208) \ - + ENABLED(E2_IS_L6470) - #error "Please enable only one stepper driver for the E2 axis." +#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) + #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." #endif -#if 1 < 0 \ - + ENABLED(E3_IS_TMC26X) \ - + ENABLED(E3_IS_TMC2130) \ - + ENABLED(E3_IS_TMC2208) \ - + ENABLED(E3_IS_L6470) - #error "Please enable only one stepper driver for the E3 axis." +#if ENABLED(TMC_Z_CALIBRATION) && !AXIS_IS_TMC(Z) && !AXIS_IS_TMC(Z2) + #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis" #endif -#if 1 < 0 \ - + ENABLED(E4_IS_TMC26X) \ - + ENABLED(E4_IS_TMC2130) \ - + ENABLED(E4_IS_TMC2208) \ - + ENABLED(E4_IS_L6470) - #error "Please enable only one stepper driver for the E4 axis." + +#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD + #error "SENSORLESS_HOMING requires TMC2130 or TMC2660 stepper drivers." #endif +#if ENABLED(STEALTHCHOP) && !HAS_STEALTHCHOP + #error "STEALTHCHOP requires TMC2130 or TMC2208 stepper drivers." + #endif /** * Digipot requirement diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.h b/Marlin/src/lcd/dogm/status_screen_DOGM.h index fc8f2324c0..d8d8b252d8 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.h +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.h @@ -72,7 +72,7 @@ FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, cons } if (PAGE_CONTAINS(21, 28)) { - _draw_centered_temp(0.5 + ( + _draw_centered_temp(0.5f + ( #if HAS_HEATED_BED isBed ? thermalManager.degBed() : #endif diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h index 23a7f1a10a..c59a3176e3 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h @@ -877,11 +877,11 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) { #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t progress_bar_percent; + uint8_t progress_bar_percent = 0; #endif - // Set current percentage from SD when actively printing - #if ENABLED(SDSUPPORT) + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) + // Progress bar % comes from SD when actively printing if (IS_SD_PRINTING) progress_bar_percent = card.percentDone(); #endif diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index e226d0e52c..b2eca477a3 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -9,6 +9,7 @@ #ifndef _FONT_UTILS_H #define _FONT_UTILS_H +#include #include #include "../core/macros.h" #include // wchar_t diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index fe766d1211..679ed1cf3f 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Orichen X") #define MSG_AUTO_HOME_Y _UxGT("Orichen Y") #define MSG_AUTO_HOME_Z _UxGT("Orichen Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Orichen XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Encetar (pretar)") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Vinient punto") diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 2bd7c7e2be..cd86dbe6b2 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -40,6 +40,7 @@ #define MSG_AUTOSTART _UxGT("Автостарт") #define MSG_DISABLE_STEPPERS _UxGT("Изкл. двигатели") #define MSG_AUTO_HOME _UxGT("Паркиране") +#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровка Z") #define MSG_SET_HOME_OFFSETS _UxGT("Задай Начало") #define MSG_SET_ORIGIN _UxGT("Изходна точка") #define MSG_PREHEAT_1 _UxGT("Подгряване PLA") diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index dd1c8117fb..31007b7352 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -45,6 +45,7 @@ #define MSG_AUTO_HOME_X _UxGT("X a origen") #define MSG_AUTO_HOME_Y _UxGT("Y a origen") #define MSG_AUTO_HOME_Z _UxGT("Z a origen") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Premeu per iniciar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Següent punt") diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index bb79f68181..4a30f928d6 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -52,6 +52,7 @@ #define MSG_AUTO_HOME_X _UxGT("Domů osa X") #define MSG_AUTO_HOME_Y _UxGT("Domů osa Y") #define MSG_AUTO_HOME_Z _UxGT("Domů osa Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovat Z") #define MSG_LEVEL_BED_HOMING _UxGT("Měření podložky") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Další bod") diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index af09e174a0..0782b96531 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Home X") #define MSG_AUTO_HOME_Y _UxGT("Home Y") #define MSG_AUTO_HOME_Z _UxGT("Home Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrer Z") #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klik når du er klar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Næste punkt") diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 67b79d7b57..75d1d7aa2a 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -48,6 +48,7 @@ #define MSG_AUTO_HOME_X _UxGT("Home X") #define MSG_AUTO_HOME_Y _UxGT("Home Y") #define MSG_AUTO_HOME_Z _UxGT("Home Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriere Z") #define MSG_LEVEL_BED_HOMING _UxGT("Home XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klick für Start") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nächste Koordinate") diff --git a/Marlin/src/lcd/language/language_el-gr.h b/Marlin/src/lcd/language/language_el-gr.h index 90b44849de..04a1198f32 100644 --- a/Marlin/src/lcd/language/language_el-gr.h +++ b/Marlin/src/lcd/language/language_el-gr.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") #define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") #define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") #define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά στο αρχικό σημείο ΧΥΖ") #define MSG_LEVEL_BED_WAITING _UxGT("Κάντε κλικ για να ξεκινήσετε") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 9fc326c440..2a90098308 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") #define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") #define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") #define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά Επ. Εκτύπωσης") //SHORTEN #define MSG_LEVEL_BED_WAITING _UxGT("Επιπεδοποίηση επ. Εκτύπωσης περιμενει") //SHORTEN #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 1cf3567662..577171b0df 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -85,6 +85,9 @@ #ifndef MSG_AUTO_HOME_Z #define MSG_AUTO_HOME_Z _UxGT("Home Z") #endif +#ifndef MSG_TMC_Z_CALIBRATION + #define MSG_TMC_Z_CALIBRATION _UxGT("Calibrate Z") +#endif #ifndef MSG_LEVEL_BED_HOMING #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #endif @@ -666,6 +669,9 @@ #ifndef MSG_STOP_PRINT #define MSG_STOP_PRINT _UxGT("Stop print") #endif +#ifndef MSG_POWER_LOSS_RECOVERY + #define MSG_POWER_LOSS_RECOVERY _UxGT("Power-Loss Recovery") +#endif #ifndef MSG_CARD_MENU #define MSG_CARD_MENU _UxGT("Print from SD") #endif diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 8ad5f3c2fe..101f38220b 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -47,6 +47,7 @@ #define MSG_AUTO_HOME_X _UxGT("Origen X") #define MSG_AUTO_HOME_Y _UxGT("Origen Y") #define MSG_AUTO_HOME_Z _UxGT("Origen Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index c28eaa6f94..999855ef37 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -47,6 +47,7 @@ #define MSG_AUTO_HOME_X _UxGT("X jatorrira") #define MSG_AUTO_HOME_Y _UxGT("Y jatorrira") #define MSG_AUTO_HOME_Z _UxGT("Z jatorrira") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibratu Z") #define MSG_LEVEL_BED_HOMING _UxGT("XYZ hasieraratzen") #define MSG_LEVEL_BED_WAITING _UxGT("Klik egin hasteko") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Hurrengo Puntua") diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 383e2d03a3..4a79946f94 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -40,6 +40,7 @@ #define MSG_AUTOSTART _UxGT("Automaatti") #define MSG_DISABLE_STEPPERS _UxGT("Vapauta moottorit") #define MSG_AUTO_HOME _UxGT("Aja referenssiin") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibroi Z") #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") #define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 9b05a05e82..dbff74c348 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -47,6 +47,7 @@ #define MSG_AUTO_HOME_X _UxGT("Origine X Auto.") #define MSG_AUTO_HOME_Y _UxGT("Origine Y Auto.") #define MSG_AUTO_HOME_Z _UxGT("Origine Z Auto.") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrer Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origine XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Clic pour commencer") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Point suivant") diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 24e7c81301..960cc8cace 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Ir orixe X") #define MSG_AUTO_HOME_Y _UxGT("Ir orixe Y") #define MSG_AUTO_HOME_Z _UxGT("Ir orixe Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Ir orixes XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Prema pulsador") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Seguinte punto") @@ -251,4 +252,3 @@ #endif // LCD_HEIGHT < 4 #endif // LANGUAGE_GL_H - diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 3b8fdd7433..efdeae8b5b 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Home-aj X") #define MSG_AUTO_HOME_Y _UxGT("Home-aj Y") #define MSG_AUTO_HOME_Z _UxGT("Home-aj Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriraj Z") #define MSG_LEVEL_BED_HOMING _UxGT("Home-aj XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klikni za početak") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sljedeća točka") diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 6720bc5d00..d19f8a20b5 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -46,6 +46,7 @@ #define MSG_AUTO_HOME_X _UxGT("Home asse X") #define MSG_AUTO_HOME_Y _UxGT("Home asse Y") #define MSG_AUTO_HOME_Z _UxGT("Home asse Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") #define MSG_LEVEL_BED_HOMING _UxGT("Home assi XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Premi per iniziare") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Punto successivo") diff --git a/Marlin/src/lcd/language/language_jp-kana.h b/Marlin/src/lcd/language/language_jp-kana.h index 8d71925f90..eedfa20cd6 100644 --- a/Marlin/src/lcd/language/language_jp-kana.h +++ b/Marlin/src/lcd/language/language_jp-kana.h @@ -52,6 +52,7 @@ #define MSG_AUTO_HOME_X _UxGT("Xジク ゲンテンフッキ") // "Home X" #define MSG_AUTO_HOME_Y _UxGT("Yジク ゲンテンフッキ") // "Home Y" #define MSG_AUTO_HOME_Z _UxGT("Zジク ゲンテンフッキ") // "Home Z" +#define MSG_TMC_Z_CALIBRATION _UxGT("Zジク コウセイ") #define MSG_LEVEL_BED_HOMING _UxGT("ゲンテンフッキチュウ") // "Homing XYZ" #define MSG_LEVEL_BED_WAITING _UxGT("レベリングカイシ") // "Click to Begin" #define MSG_LEVEL_BED_NEXT_POINT _UxGT("ツギノソクテイテンヘ") // "Next Point" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 0a2726294d..128bceaf41 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -47,6 +47,7 @@ #define MSG_AUTO_HOME_X _UxGT("Home X") #define MSG_AUTO_HOME_Y _UxGT("Home Y") #define MSG_AUTO_HOME_Z _UxGT("Home Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibreer Z") #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klik voor begin") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Volgende Plaats") diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index b246df9f37..6ac55ff47e 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -42,6 +42,7 @@ #define MSG_AUTO_HOME_X _UxGT("Zeruj X") #define MSG_AUTO_HOME_Y _UxGT("Zeruj Y") #define MSG_AUTO_HOME_Z _UxGT("Zeruj Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibruj Z") #define MSG_LEVEL_BED _UxGT("Poziom. stołu") #define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") diff --git a/Marlin/src/lcd/language/language_pt-br.h b/Marlin/src/lcd/language/language_pt-br.h index 467153156b..0d7ffe84c4 100644 --- a/Marlin/src/lcd/language/language_pt-br.h +++ b/Marlin/src/lcd/language/language_pt-br.h @@ -50,6 +50,7 @@ #define MSG_AUTO_HOME_X _UxGT("Ir na origem X") #define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") #define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") #define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") #define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 6901b53d57..a3e1256f6a 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Ir para origem X") #define MSG_AUTO_HOME_Y _UxGT("Ir para origem Y") #define MSG_AUTO_HOME_Z _UxGT("Ir para origem Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") #define MSG_LEVEL_BED_WAITING _UxGT("Click para iniciar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo ponto") diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 60cb707c17..1f419607bd 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -48,6 +48,7 @@ #define MSG_AUTO_HOME_X _UxGT("Парковка X") #define MSG_AUTO_HOME_Y _UxGT("Парковка Y") #define MSG_AUTO_HOME_Z _UxGT("Парковка Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровать Z") #define MSG_LEVEL_BED_HOMING _UxGT("Нулевое положение") #define MSG_LEVEL_BED_WAITING _UxGT("Нажмите чтобы начать") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Следующая точка") diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index e3d83c649f..a7ff8a7bc4 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -48,6 +48,7 @@ #define MSG_SD_INSERTED _UxGT("Karta vložená") #define MSG_SD_REMOVED _UxGT("Karta vybratá") #define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znakov +#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft.endstopy") #define MSG_MAIN _UxGT("Hlavná ponuka") #define MSG_AUTOSTART _UxGT("Autoštart") #define MSG_DISABLE_STEPPERS _UxGT("Uvolniť motory") @@ -57,6 +58,7 @@ #define MSG_AUTO_HOME_X _UxGT("Domov os X") #define MSG_AUTO_HOME_Y _UxGT("Domov os Y") #define MSG_AUTO_HOME_Z _UxGT("Domov os Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovať Z") #define MSG_LEVEL_BED_HOMING _UxGT("Meranie podložky") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Ďalší bod") @@ -212,6 +214,7 @@ #define MSG_VC_JERK _UxGT("Vz-skok") #endif #define MSG_VE_JERK _UxGT("Ve-skok") +#define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") #define MSG_VELOCITY _UxGT("Rýchlosť") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -259,8 +262,9 @@ #define MSG_CARD_MENU _UxGT("Tlačiť z SD") #define MSG_NO_CARD _UxGT("Žiadna SD karta") #define MSG_DWELL _UxGT("Spím...") -#define MSG_USERWAIT _UxGT("Čakám...") +#define MSG_USERWAIT _UxGT("Kliknutím pokrač.") #define MSG_PRINT_PAUSED _UxGT("Tlač pozastavená") +#define MSG_PRINTING _UxGT("Tlačím...") #define MSG_PRINT_ABORTED _UxGT("Tlač zrušená") #define MSG_NO_MOVE _UxGT("Žiadny pohyb.") #define MSG_KILLED _UxGT("PRERUŠENÉ. ") @@ -312,7 +316,6 @@ #define MSG_SHORT_MINUTE _UxGT("m") #define MSG_HEATING _UxGT("Ohrev...") #define MSG_COOLING _UxGT("Ochladzovanie...") -#define MSG_COOLING_COMPLETE _UxGT("Ochladzovanie prebehlo.") #define MSG_BED_HEATING _UxGT("Ohrev podl...") #define MSG_BED_COOLING _UxGT("Ochladzovanie podl...") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrácia") @@ -323,6 +326,7 @@ #define MSG_DELTA_SETTINGS _UxGT("Delta nastavenia") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrácia") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.výšku delty") +#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Offset sondy Z") #define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") #define MSG_DELTA_HEIGHT _UxGT("Výška") #define MSG_DELTA_RADIUS _UxGT("Polomer") diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 848d6b1b71..7b15a57000 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -47,6 +47,7 @@ #define MSG_AUTO_HOME_X _UxGT("X Sıfırla") // X Sıfırla #define MSG_AUTO_HOME_Y _UxGT("Y Sıfırla") // Y Sıfırla #define MSG_AUTO_HOME_Z _UxGT("Z Sıfırla") // Z Sıfırla +#define MSG_TMC_Z_CALIBRATION _UxGT("Ayarla Z") #define MSG_LEVEL_BED_HOMING _UxGT("XYZ Sıfırlanıyor") // XYZ Sıfırlanıyor #define MSG_LEVEL_BED_WAITING _UxGT("Başlatmak için tıkla") // Başlatmak için tıkla #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sıradaki Nokta") // Sıradaki Nokta diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index ce131d8542..384a90c669 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -44,6 +44,7 @@ #define MSG_AUTO_HOME_X _UxGT("Паркування X") #define MSG_AUTO_HOME_Y _UxGT("Паркування Y") #define MSG_AUTO_HOME_Z _UxGT("Паркування Z") +#define MSG_TMC_Z_CALIBRATION _UxGT("Калібрування Z") #define MSG_LEVEL_BED_HOMING _UxGT("Паркування XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Почати") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Слідуюча Точка") diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index a348e40712..6cf63f6e1d 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -48,6 +48,7 @@ #define MSG_AUTO_HOME_X _UxGT("回X原位") //"Home X" #define MSG_AUTO_HOME_Y _UxGT("回Y原位") //"Home Y" #define MSG_AUTO_HOME_Z _UxGT("回Z原位") //"Home Z" +#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校准Z") #define MSG_LEVEL_BED_HOMING _UxGT("平台调平XYZ归原位") //"Homing XYZ" #define MSG_LEVEL_BED_WAITING _UxGT("单击开始热床调平") //"Click to Begin" #define MSG_LEVEL_BED_NEXT_POINT _UxGT("下个热床调平点") //"Next Point" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index d57f2deef9..8455843773 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -48,6 +48,7 @@ #define MSG_AUTO_HOME_X _UxGT("回X原點") //"Home X" #define MSG_AUTO_HOME_Y _UxGT("回Y原點") //"Home Y" #define MSG_AUTO_HOME_Z _UxGT("回Z原點") //"Home Z" +#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校準Z") #define MSG_LEVEL_BED_HOMING _UxGT("平台調平XYZ歸原點") //"Homing XYZ" #define MSG_LEVEL_BED_WAITING _UxGT("單擊開始熱床調平") //"Click to Begin" #define MSG_LEVEL_BED_NEXT_POINT _UxGT("下個熱床調平點") //"Next Point" diff --git a/Marlin/src/lcd/malyanlcd.cpp b/Marlin/src/lcd/malyanlcd.cpp index daeeba2f38..d02a330244 100644 --- a/Marlin/src/lcd/malyanlcd.cpp +++ b/Marlin/src/lcd/malyanlcd.cpp @@ -77,6 +77,9 @@ // Track incoming command bytes from the LCD int inbound_count; +// For sending print completion messages +bool last_printing_status = false; + // Everything written needs the high bit set. void write_to_lcd_P(const char * const message) { char encoded_message[MAX_CURLY_COMMAND]; @@ -106,22 +109,23 @@ void write_to_lcd(const char * const message) { * {C:P050} * Set temp for bed to 50 * + * {C:S09} set feedrate to 90 %. + * {C:S12} set feedrate to 120 %. + * * the command portion begins after the : */ void process_lcd_c_command(const char* command) { switch (command[0]) { + case 'C': { + int raw_feedrate = atoi(command + 1); + feedrate_percentage = raw_feedrate * 10; + feedrate_percentage = constrain(feedrate_percentage, 10, 999); + } break; case 'T': { - // M104 S - char cmd[20]; - sprintf_P(cmd, PSTR("M104 S%s"), command + 1); - enqueue_and_echo_command_now(cmd); + thermalManager.setTargetHotend(atoi(command + 1), 0); } break; - case 'P': { - // M140 S - char cmd[20]; - sprintf_P(cmd, PSTR("M140 S%s"), command + 1); - enqueue_and_echo_command_now(cmd); + thermalManager.setTargetBed(atoi(command + 1)); } break; default: @@ -240,6 +244,7 @@ void process_lcd_p_command(const char* command) { #if ENABLED(SDSUPPORT) // cancel print write_to_lcd_P(PSTR("{SYS:CANCELING}")); + last_printing_status = false; card.stopSDPrint( #if SD_RESORT true @@ -280,7 +285,7 @@ void process_lcd_p_command(const char* command) { } else { char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.filename); + sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.longest_filename()); write_to_lcd(message_buffer); write_to_lcd_P(PSTR("{SYS:BUILD}")); card.openAndPrintFile(card.filename); @@ -338,7 +343,7 @@ void process_lcd_s_command(const char* command) { uint16_t file_count = card.get_num_Files(); for (uint16_t i = 0; i < file_count; i++) { card.getfilename(i); - sprintf_P(message_buffer, card.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.filename); + sprintf_P(message_buffer, card.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.longest_filename()); write_to_lcd(message_buffer); } @@ -395,7 +400,7 @@ void process_lcd_command(const char* command) { /** * UC means connected. * UD means disconnected - * The stock firmware considers USB initialied as "connected." + * The stock firmware considers USB initialized as "connected." */ void update_usb_status(const bool forceUpdate) { static bool last_usb_connected_status = false; @@ -433,14 +438,21 @@ void lcd_update() { } #if ENABLED(SDSUPPORT) - // If there's a print in progress, we need to emit the status as - // {TQ:} - if (card.sdprinting) { - // We also need to send: T:-2538.0 E:0 - // I have no idea what this means. + // The way last printing status works is simple: + // The UI needs to see at least one TQ which is not 100% + // and then when the print is complete, one which is. + static uint8_t last_percent_done = 100; + + // If there was a print in progress, we need to emit the final + // print status as {TQ:100}. Reset last percent done so a new print will + // issue a percent of 0. + const uint8_t percent_done = card.sdprinting ? card.percentDone() : last_printing_status ? 100 : 0; + if (percent_done != last_percent_done) { char message_buffer[10]; - sprintf_P(message_buffer, PSTR("{TQ:%03i}"), card.percentDone()); + sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done); write_to_lcd(message_buffer); + last_percent_done = percent_done; + last_printing_status = card.sdprinting; } #endif } diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 2ffaba11ad..02f2bfe0a9 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -94,6 +94,8 @@ #define THERMISTOR_NAME "PT100 4K7" #elif THERMISTOR_ID == 110 #define THERMISTOR_NAME "PT100 1K" +#elif THERMISTOR_ID == 666 + #define THERMISTOR_NAME "Einstart S" // High Temperature thermistors #elif THERMISTOR_ID == 66 diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 45a0b44b4b..64610e044b 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -277,8 +277,8 @@ uint16_t max_display_update_time = 0; #if ENABLED(SDSUPPORT) void lcd_sdcard_menu(); - void menu_action_sdfile(const char* filename, char* longFilename); - void menu_action_sddirectory(const char* filename, char* longFilename); + void menu_action_sdfile(CardReader &theCard); + void menu_action_sddirectory(CardReader &theCard); #endif //////////////////////////////////////////// @@ -479,7 +479,7 @@ uint16_t max_display_update_time = 0; #if IS_KINEMATIC bool processing_manual_move = false; - float manual_move_offset = 0.0; + float manual_move_offset = 0; #else constexpr bool processing_manual_move = false; #endif @@ -768,7 +768,7 @@ void lcd_reset_status() { msg = paused; #if ENABLED(SDSUPPORT) else if (card.sdprinting) - return lcd_setstatus(card.longFilename[0] ? card.longFilename : card.filename, true); + return lcd_setstatus(card.longest_filename(), true); #endif else if (print_job_timer.isRunning()) msg = printing; @@ -873,21 +873,13 @@ void lcd_quick_feedback(const bool clear_buttons) { abort_sd_printing = true; lcd_setstatusPGM(PSTR(MSG_PRINT_ABORTED), -1); lcd_return_to_status(); - - #if ENABLED(POWER_LOSS_RECOVERY) - card.openJobRecoveryFile(false); - job_recovery_info.valid_head = job_recovery_info.valid_foot = 0; - (void)card.saveJobRecoveryInfo(); - card.closeJobRecoveryFile(); - job_recovery_commands_count = 0; - #endif } #endif // SDSUPPORT #if ENABLED(POWER_LOSS_RECOVERY) - static void lcd_sdcard_recover_job() { + static void lcd_power_loss_recovery_resume() { char cmd[20]; // Return to status now @@ -895,45 +887,65 @@ void lcd_quick_feedback(const bool clear_buttons) { // Turn leveling off and home enqueue_and_echo_commands_P(PSTR("M420 S0\nG28" - #if !IS_KINEMATIC + #if ENABLED(MARLIN_DEV_MODE) + " S" + #elif !IS_KINEMATIC " X Y" #endif )); #if HAS_HEATED_BED - // Restore the bed temperature - sprintf_P(cmd, PSTR("M190 S%i"), job_recovery_info.target_temperature_bed); - enqueue_and_echo_command(cmd); + const int16_t bt = job_recovery_info.target_temperature_bed; + if (bt) { + // Restore the bed temperature + sprintf_P(cmd, PSTR("M190 S%i"), bt); + enqueue_and_echo_command(cmd); + } #endif // Restore all hotend temperatures HOTEND_LOOP() { - sprintf_P(cmd, PSTR("M109 S%i"), job_recovery_info.target_temperature[e]); - enqueue_and_echo_command(cmd); + const int16_t et = job_recovery_info.target_temperature[e]; + if (et) { + #if HOTENDS > 1 + sprintf_P(cmd, PSTR("T%i"), e); + enqueue_and_echo_command(cmd); + #endif + sprintf_P(cmd, PSTR("M109 S%i"), et); + enqueue_and_echo_command(cmd); + } } + #if HOTENDS > 1 + sprintf_P(cmd, PSTR("T%i"), job_recovery_info.active_hotend); + enqueue_and_echo_command(cmd); + #endif + // Restore print cooling fan speeds for (uint8_t i = 0; i < FAN_COUNT; i++) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, job_recovery_info.fanSpeeds[i]); - enqueue_and_echo_command(cmd); + int16_t f = job_recovery_info.fanSpeeds[i]; + if (f) { + sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); + enqueue_and_echo_command(cmd); + } } // Start draining the job recovery command queue job_recovery_phase = JOB_RECOVERY_YES; + } - // Resume the print job timer - if (job_recovery_info.print_job_elapsed) - print_job_timer.resume(job_recovery_info.print_job_elapsed); - - // Start getting commands from SD - card.startFileprint(); + static void lcd_power_loss_recovery_cancel() { + card.removeJobRecoveryFile(); + card.autostart_index = 0; + lcd_return_to_status(); } static void lcd_job_recovery_menu() { defer_return_to_status = true; START_MENU(); - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_recover_job); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); + STATIC_ITEM(MSG_POWER_LOSS_RECOVERY); + MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); + MENU_ITEM(function, MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); END_MENU(); } @@ -990,9 +1002,9 @@ void lcd_quick_feedback(const bool clear_buttons) { bar_percent = constrain(bar_percent, 0, 100); encoderPosition = 0; lcd_implementation_drawmenu_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true); - lcd.setCursor((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2); - lcd.print(itostr3(bar_percent)); lcd.write('%'); - lcd.setCursor(0, LCD_HEIGHT - 1); lcd_draw_progress_bar(bar_percent); + lcd_moveto((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2); + lcd_put_u8str(int(bar_percent)); lcd_put_wchar('%'); + lcd_moveto(0, LCD_HEIGHT - 1); lcd_draw_progress_bar(bar_percent); } void _progress_bar_test() { @@ -1273,13 +1285,13 @@ void lcd_quick_feedback(const bool clear_buttons) { ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1; ubl.encoder_diff = 0; - mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005 / 2.0; + mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005f * 0.5f; mesh_edit_value = mesh_edit_accumulator; encoderPosition = 0; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - const int32_t rounded = (int32_t)(mesh_edit_value * 1000.0); - mesh_edit_value = float(rounded - (rounded % 5L)) / 1000.0; + const int32_t rounded = (int32_t)(mesh_edit_value * 1000); + mesh_edit_value = float(rounded - (rounded % 5L)) / 1000; } if (lcdDrawUpdate) { @@ -1407,7 +1419,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // Leveling Fade Height // #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(SLIM_LCD_MENUS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); #endif // @@ -1966,7 +1978,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // if (encoderPosition) { const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_Z_STEP); - line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5)); + line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f)); lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; encoderPosition = 0; } @@ -1976,7 +1988,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // if (lcdDrawUpdate) { const float v = current_position[Z_AXIS]; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+')); + lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); } } @@ -2413,9 +2425,6 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_output_map_lcd() { static int16_t step_scaler = 0; - if (!all_axes_known()) - return lcd_goto_screen(_lcd_ubl_map_homing); - if (use_click()) return _lcd_ubl_map_lcd_edit_cmd(); ENCODER_DIRECTION_NORMAL(); @@ -2559,7 +2568,7 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu); MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); #endif END_MENU(); } @@ -2567,7 +2576,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // AUTO_BED_LEVELING_UBL - #if ENABLED(LCD_BED_LEVELING) || (PLANNER_LEVELING && DISABLED(SLIM_LCD_MENUS)) + #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } #endif @@ -2615,7 +2624,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // Z Fade Height #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); #endif // @@ -2677,6 +2686,13 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); #endif + // + // TMC Z Calibration + // + #if ENABLED(TMC_Z_CALIBRATION) + MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915")); + #endif + // // Level Bed // @@ -2691,7 +2707,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling); - #elif PLANNER_LEVELING && DISABLED(SLIM_LCD_MENUS) + #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) #if DISABLED(PROBE_MANUALLY) MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29")); @@ -2701,7 +2717,7 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); } #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); #endif #endif @@ -2865,15 +2881,15 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_delta_settings() { START_MENU(); MENU_BACK(MSG_DELTA_CALIBRATE); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5.0, delta_radius + 5.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5.0, 5.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5.0, 5.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5.0, 5.0, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5.0, delta_diagonal_rod + 5.0, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5, 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5, 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5, 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5, 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5, 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5, 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); END_MENU(); } @@ -2929,7 +2945,7 @@ void lcd_quick_feedback(const bool clear_buttons) { destination[manual_move_axis] += manual_move_offset; // Reset for the next move - manual_move_offset = 0.0; + manual_move_offset = 0; manual_move_axis = (int8_t)NO_AXIS; // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to @@ -2969,7 +2985,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif manual_move_e_index = eindex >= 0 ? eindex : active_extruder; #endif - manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves + manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves manual_move_axis = (int8_t)axis; } @@ -3053,7 +3069,7 @@ void lcd_quick_feedback(const bool clear_buttons) { + manual_move_offset #endif , axis); - lcd_implementation_drawedit(name, move_menu_scale >= 0.1 ? ftostr41sign(pos) : ftostr43sign(pos)); + lcd_implementation_drawedit(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); } } void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); } @@ -3138,9 +3154,9 @@ void lcd_quick_feedback(const bool clear_buttons) { move_menu_scale = scale; lcd_goto_screen(_manual_move_func_ptr); } - void lcd_move_menu_10mm() { _goto_manual_move(10.0); } - void lcd_move_menu_1mm() { _goto_manual_move( 1.0); } - void lcd_move_menu_01mm() { _goto_manual_move( 0.1); } + void lcd_move_menu_10mm() { _goto_manual_move(10); } + void lcd_move_menu_1mm() { _goto_manual_move( 1); } + void lcd_move_menu_01mm() { _goto_manual_move( 0.1f); } void _lcd_move_distance_menu(const AxisEnum axis, const screenFunc_t func) { _manual_move_func_ptr = func; @@ -3515,9 +3531,9 @@ void lcd_quick_feedback(const bool clear_buttons) { // #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); - MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15); - MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15); - MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0.0, 1.0); + MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - 15); + MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); + MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 1); #endif // @@ -3534,7 +3550,7 @@ void lcd_quick_feedback(const bool clear_buttons) { raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \ raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \ MENU_ITEM_EDIT(float52sign, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \ + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01f, 9990, copy_and_scalePID_i_E ## eindex); \ MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) #if ENABLED(PID_EXTRUSION_SCALING) @@ -3656,7 +3672,7 @@ void lcd_quick_feedback(const bool clear_buttons) { if (e == active_extruder) _planner_refresh_positioning(); else - planner.steps_to_mm[E_AXIS + e] = 1.0 / planner.axis_steps_per_mm[E_AXIS + e]; + planner.steps_to_mm[E_AXIS + e] = 1.0f / planner.axis_steps_per_mm[E_AXIS + e]; } void _planner_refresh_e0_positioning() { _planner_refresh_e_positioning(0); } void _planner_refresh_e1_positioning() { _planner_refresh_e_positioning(1); } @@ -3752,14 +3768,14 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_BACK(MSG_MOTION); #if ENABLED(JUNCTION_DEVIATION) - MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01, 0.3, planner.recalculate_max_e_jerk_factor); + MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f, planner.recalculate_max_e_jerk); #else MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VA_JERK, &planner.max_jerk[A_AXIS], 1, 990); MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VB_JERK, &planner.max_jerk[B_AXIS], 1, 990); #if ENABLED(DELTA) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 1, 990); #else - MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1, 990); + MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); #endif MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990); #endif @@ -3857,17 +3873,17 @@ void lcd_quick_feedback(const bool clear_buttons) { if (parser.volumetric_enabled) { #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5, 3.25, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5, 3.25, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5, 3.25, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5, 3.25, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5, 3.25, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 @@ -3880,39 +3896,39 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(PREVENT_LENGTHY_EXTRUDE) EXTRUDE_MAXLENGTH #else - 999.0f + 999 #endif ; #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[0], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[0], 0, extrude_maxlength); #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[active_extruder], 0.0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E1, &filament_change_unload_length[0], 0.0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E2, &filament_change_unload_length[1], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[active_extruder], 0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E1, &filament_change_unload_length[0], 0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E2, &filament_change_unload_length[1], 0, extrude_maxlength); #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E3, &filament_change_unload_length[2], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E3, &filament_change_unload_length[2], 0, extrude_maxlength); #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E4, &filament_change_unload_length[3], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E4, &filament_change_unload_length[3], 0, extrude_maxlength); #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E5, &filament_change_unload_length[4], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E5, &filament_change_unload_length[4], 0, extrude_maxlength); #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[0], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[0], 0, extrude_maxlength); #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[active_extruder], 0.0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E1, &filament_change_load_length[0], 0.0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E2, &filament_change_load_length[1], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[active_extruder], 0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E1, &filament_change_load_length[0], 0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E2, &filament_change_load_length[1], 0, extrude_maxlength); #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E3, &filament_change_load_length[2], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E3, &filament_change_load_length[2], 0, extrude_maxlength); #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E4, &filament_change_load_length[3], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E4, &filament_change_load_length[3], 0, extrude_maxlength); #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E5, &filament_change_load_length[4], 0.0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E5, &filament_change_load_length[4], 0, extrude_maxlength); #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 @@ -4033,9 +4049,9 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif if (card.filenameIsDir) - MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); + MENU_ITEM(sddirectory, MSG_CARD_MENU, card); else - MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename); + MENU_ITEM(sdfile, MSG_CARD_MENU, card); } else { MENU_ITEM_DUMMY(); @@ -4812,9 +4828,9 @@ void lcd_quick_feedback(const bool clear_buttons) { if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ if (lcdDrawUpdate) \ - lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) * (1.0 / _scale))); \ + lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale))); \ if (lcd_clicked || (liveEdit && lcdDrawUpdate)) { \ - _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0 / _scale); \ + _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale); \ if (editValue != NULL) *((_type*)editValue) = value; \ if (callbackFunc && (liveEdit || lcd_clicked)) (*callbackFunc)(); \ if (lcd_clicked) lcd_goto_previous_menu(); \ @@ -4845,14 +4861,14 @@ void lcd_quick_feedback(const bool clear_buttons) { DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1); DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1.0); - DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100.0); - DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000.0); - DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01); - DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10.0); - DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100.0); - DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100.0); - DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01); + DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1); + DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100); + DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000); + DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f); + DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10); + DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100); + DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100); + DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f); /** * @@ -4956,19 +4972,17 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(SDSUPPORT) - void menu_action_sdfile(const char* filename, char* longFilename) { + void menu_action_sdfile(CardReader &theCard) { #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use #endif - UNUSED(longFilename); - card.openAndPrintFile(filename); + card.openAndPrintFile(theCard.filename); lcd_return_to_status(); lcd_reset_status(); } - void menu_action_sddirectory(const char* filename, char* longFilename) { - UNUSED(longFilename); - card.chdir(filename); + void menu_action_sddirectory(CardReader &theCard) { + card.chdir(theCard.filename); encoderTopLine = 0; encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; screen_changed = true; @@ -5216,7 +5230,7 @@ void lcd_update() { if (lastEncoderMovementMillis) { // Note that the rate is always calculated between two passes through the // loop and that the abs of the encoderDiff value is tracked. - float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000.0; + float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000; if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; diff --git a/Marlin/src/lcd/ultralcd_common_HD44780.h b/Marlin/src/lcd/ultralcd_common_HD44780.h index b366459cb3..970dbbf35a 100644 --- a/Marlin/src/lcd/ultralcd_common_HD44780.h +++ b/Marlin/src/lcd/ultralcd_common_HD44780.h @@ -52,8 +52,6 @@ #endif #endif -#include - extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. //////////////////////////////////// @@ -199,5 +197,3 @@ enum HD44780CharSet : char { }; #endif // ULTRALCD_COMMON_HD44780_H - - diff --git a/Marlin/src/lcd/ultralcd_impl_DOGM.h b/Marlin/src/lcd/ultralcd_impl_DOGM.h index f9b0fb452b..7442f17d4e 100644 --- a/Marlin/src/lcd/ultralcd_impl_DOGM.h +++ b/Marlin/src/lcd/ultralcd_impl_DOGM.h @@ -120,7 +120,7 @@ // LCD selection #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #ifdef DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) + #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_RS); // 2 stripes, HW SPI (shared with SD card) #else U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS); // Original u8glib device. 2 stripes, SW SPI @@ -181,6 +181,9 @@ // The MINIPanel display //U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes U8GLIB_MINI12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes +#elif ENABLED(U8GLIB_SH1106_EINSTART) + // Connected via motherboard header + U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS); #else // for regular DOGM128 display with HW-SPI //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 // 8 stripes @@ -298,9 +301,9 @@ static void lcd_implementation_init() { #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) SET_OUTPUT(LCD_PINS_DC); - OUT_WRITE(LCD_PINS_RS, LOW); - _delay_ms(500); - WRITE(LCD_PINS_RS, HIGH); + #if !defined(LCD_RESET_PIN) + #define LCD_RESET_PIN LCD_PINS_RS + #endif #endif #if PIN_EXISTS(LCD_RESET) @@ -310,7 +313,7 @@ static void lcd_implementation_init() { _delay_ms(5); // delay to allow the display to initalize #endif - #if PIN_EXISTS(LCD_RESET) || ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) + #if PIN_EXISTS(LCD_RESET) u8g.begin(); #endif @@ -518,7 +521,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #if ENABLED(SDSUPPORT) - static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const bool isDir) { + static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, CardReader &theCard, const bool isDir) { UNUSED(pstr); lcd_implementation_mark_as_selected(row, isSelected); @@ -526,23 +529,23 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop if (!PAGE_CONTAINS(row_y1, row_y2)) return; constexpr uint8_t maxlen = LCD_WIDTH - (START_COL) - 1; - const char *outstr = longFilename[0] ? longFilename : filename; - if (longFilename[0]) { + const char *outstr = theCard.longest_filename(); + if (theCard.longFilename[0]) { #if ENABLED(SCROLL_LONG_FILENAMES) if (isSelected) { uint8_t name_hash = row; for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ filename[l]; // rotate, xor + name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor if (filename_scroll_hash != name_hash) { // If the hash changed... filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(longFilename) - maxlen); // Update the scroll limit + filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - maxlen); // Update the scroll limit filename_scroll_pos = 0; // Reset scroll to the start lcd_status_update_delay = 8; // Don't scroll right away } outstr += filename_scroll_pos; } #else - longFilename[maxlen] = '\0'; // cutoff at screen edge + theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge #endif } @@ -554,8 +557,8 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop while (n - DOG_CHAR_WIDTH > 0) { n -= lcd_put_wchar(' '); } } - #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false) - #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, true) + #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, false) + #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, true) #endif // SDSUPPORT diff --git a/Marlin/src/lcd/ultralcd_impl_HD44780.h b/Marlin/src/lcd/ultralcd_impl_HD44780.h index 4ea2fdc22b..61437f5c3f 100644 --- a/Marlin/src/lcd/ultralcd_impl_HD44780.h +++ b/Marlin/src/lcd/ultralcd_impl_HD44780.h @@ -926,29 +926,29 @@ static void lcd_implementation_status_screen() { #if ENABLED(SDSUPPORT) - static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const uint8_t concat, const char post_char) { + static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, CardReader &theCard, const uint8_t concat, const char post_char) { UNUSED(pstr); lcd_moveto(0, row); lcd_put_wchar(sel ? '>' : ' '); uint8_t n = LCD_WIDTH - concat; - const char *outstr = longFilename[0] ? longFilename : filename; - if (longFilename[0]) { + const char *outstr = theCard.longest_filename(); + if (theCard.longFilename[0]) { #if ENABLED(SCROLL_LONG_FILENAMES) if (sel) { uint8_t name_hash = row; for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ filename[l]; // rotate, xor + name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor if (filename_scroll_hash != name_hash) { // If the hash changed... filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(longFilename) - n); // Update the scroll limit + filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - n); // Update the scroll limit filename_scroll_pos = 0; // Reset scroll to the start lcd_status_update_delay = 8; // Don't scroll right away } outstr += filename_scroll_pos; } #else - longFilename[n] = '\0'; // cutoff at screen edge + theCard.longFilename[n] = '\0'; // cutoff at screen edge #endif } @@ -960,12 +960,12 @@ static void lcd_implementation_status_screen() { lcd_put_wchar(post_char); } - static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' '); + static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, CardReader &theCard) { + lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, ' '); } - static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) { - lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]); + static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, CardReader &theCard) { + lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, LCD_STR_FOLDER[0]); } #endif // SDSUPPORT diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index c0dfbc93fb..e4fe0afaac 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -69,7 +69,7 @@ vector_3 vector_3::get_normal() { float vector_3::get_length() { return SQRT(sq(x) + sq(y) + sq(z)); } void vector_3::normalize() { - const float inv_length = 1.0 / get_length(); + const float inv_length = RSQRT(sq(x) + sq(y) + sq(z)); x *= inv_length; y *= inv_length; z *= inv_length; diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 34af1f42f3..8af22648b6 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -331,7 +331,7 @@ void MarlinSettings::postprocess() { #endif #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) - planner.recalculate_max_e_jerk_factor(); + planner.recalculate_max_e_jerk(); #endif // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm @@ -384,7 +384,7 @@ void MarlinSettings::postprocess() { * M500 - Store Configuration */ bool MarlinSettings::save(PORTARG_SOLO) { - float dummy = 0.0f; + float dummy = 0; char ver[4] = "ERR"; uint16_t working_crc = 0; @@ -417,12 +417,12 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(planner.min_travel_feedrate_mm_s); #if ENABLED(JUNCTION_DEVIATION) - const float planner_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; + const float planner_max_jerk[] = { float(DEFAULT_XJERK), float(DEFAULT_YJERK), float(DEFAULT_ZJERK), float(DEFAULT_EJERK) }; EEPROM_WRITE(planner_max_jerk); EEPROM_WRITE(planner.junction_deviation_mm); #else EEPROM_WRITE(planner.max_jerk); - dummy = 0.02; + dummy = 0.02f; EEPROM_WRITE(dummy); #endif @@ -466,7 +466,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(mesh_num_y); EEPROM_WRITE(mbl.z_values); #else // For disabled MBL write a default mesh - dummy = 0.0f; + dummy = 0; const uint8_t mesh_num_x = 3, mesh_num_y = 3; EEPROM_WRITE(dummy); // z_offset EEPROM_WRITE(mesh_num_x); @@ -488,7 +488,7 @@ void MarlinSettings::postprocess() { #if ABL_PLANAR EEPROM_WRITE(planner.bed_level_matrix); #else - dummy = 0.0; + dummy = 0; for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy); #endif @@ -512,7 +512,7 @@ void MarlinSettings::postprocess() { // For disabled Bilinear Grid write an empty 3x3 grid const uint8_t grid_max_x = 3, grid_max_y = 3; const int bilinear_start[2] = { 0 }, bilinear_grid_spacing[2] = { 0 }; - dummy = 0.0f; + dummy = 0; EEPROM_WRITE(grid_max_x); EEPROM_WRITE(grid_max_y); EEPROM_WRITE(bilinear_grid_spacing); @@ -550,7 +550,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(x_endstop_adj); // Write dual endstops in X, Y, Z order. Unused = 0.0 - dummy = 0.0f; + dummy = 0; #if ENABLED(X_DUAL_ENDSTOPS) EEPROM_WRITE(endstops.x_endstop_adj); // 1 float #else @@ -602,7 +602,7 @@ void MarlinSettings::postprocess() { { dummy = DUMMY_PID_VALUE; // When read, will not change the existing value EEPROM_WRITE(dummy); // Kp - dummy = 0.0f; + dummy = 0; for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); // Ki, Kd, Kc } @@ -681,57 +681,57 @@ void MarlinSettings::postprocess() { uint16_t tmc_stepper_current[TMC_AXES] = { #if HAS_TRINAMIC - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) stepperX.getCurrent(), #else 0, #endif - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) stepperY.getCurrent(), #else 0, #endif - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) stepperZ.getCurrent(), #else 0, #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) stepperX2.getCurrent(), #else 0, #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) stepperY2.getCurrent(), #else 0, #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) stepperZ2.getCurrent(), #else 0, #endif - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) stepperE0.getCurrent(), #else 0, #endif - #if E1_IS_TRINAMIC + #if AXIS_IS_TMC(E1) stepperE1.getCurrent(), #else 0, #endif - #if E2_IS_TRINAMIC + #if AXIS_IS_TMC(E2) stepperE2.getCurrent(), #else 0, #endif - #if E3_IS_TRINAMIC + #if AXIS_IS_TMC(E3) stepperE3.getCurrent(), #else 0, #endif - #if E4_IS_TRINAMIC + #if AXIS_IS_TMC(E4) stepperE4.getCurrent() #else 0 @@ -750,57 +750,57 @@ void MarlinSettings::postprocess() { uint32_t tmc_hybrid_threshold[TMC_AXES] = { #if ENABLED(HYBRID_THRESHOLD) - #if X_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(X) TMC_GET_PWMTHRS(X, X), #else X_HYBRID_THRESHOLD, #endif - #if Y_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Y) TMC_GET_PWMTHRS(Y, Y), #else Y_HYBRID_THRESHOLD, #endif - #if Z_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Z) TMC_GET_PWMTHRS(Z, Z), #else Z_HYBRID_THRESHOLD, #endif - #if X2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(X2) TMC_GET_PWMTHRS(X, X2), #else X2_HYBRID_THRESHOLD, #endif - #if Y2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Y2) TMC_GET_PWMTHRS(Y, Y2), #else Y2_HYBRID_THRESHOLD, #endif - #if Z2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Z2) TMC_GET_PWMTHRS(Z, Z2), #else Z2_HYBRID_THRESHOLD, #endif - #if E0_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E0) TMC_GET_PWMTHRS(E, E0), #else E0_HYBRID_THRESHOLD, #endif - #if E1_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E1) TMC_GET_PWMTHRS(E, E1), #else E1_HYBRID_THRESHOLD, #endif - #if E2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E2) TMC_GET_PWMTHRS(E, E2), #else E2_HYBRID_THRESHOLD, #endif - #if E3_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E3) TMC_GET_PWMTHRS(E, E3), #else E3_HYBRID_THRESHOLD, #endif - #if E4_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E4) TMC_GET_PWMTHRS(E, E4) #else E4_HYBRID_THRESHOLD @@ -818,17 +818,17 @@ void MarlinSettings::postprocess() { // int16_t tmc_sgt[XYZ] = { #if ENABLED(SENSORLESS_HOMING) - #if defined(X_HOMING_SENSITIVITY) && (ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)) + #if X_SENSORLESS stepperX.sgt(), #else 0, #endif - #if defined(Y_HOMING_SENSITIVITY) && (ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)) + #if Y_SENSORLESS stepperY.sgt(), #else 0, #endif - #if defined(Z_HOMING_SENSITIVITY) && (ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)) + #if Z_SENSORLESS stepperZ.sgt() #else 0 @@ -848,7 +848,7 @@ void MarlinSettings::postprocess() { #if ENABLED(LIN_ADVANCE) EEPROM_WRITE(planner.extruder_advance_K); #else - dummy = 0.0f; + dummy = 0; EEPROM_WRITE(dummy); #endif @@ -870,7 +870,7 @@ void MarlinSettings::postprocess() { #if ENABLED(CNC_COORDINATE_SYSTEMS) EEPROM_WRITE(gcode.coordinate_system); // 27 floats #else - dummy = 0.0f; + dummy = 0; for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_WRITE(dummy); #endif @@ -885,7 +885,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(planner.xz_skew_factor); EEPROM_WRITE(planner.yz_skew_factor); #else - dummy = 0.0f; + dummy = 0; for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); #endif @@ -905,7 +905,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(dummy); } #else - dummy = 0.0f; + dummy = 0; for (uint8_t q = MAX_EXTRUDERS * 2; q--;) EEPROM_WRITE(dummy); #endif @@ -1311,37 +1311,37 @@ void MarlinSettings::postprocess() { uint16_t currents[TMC_AXES]; EEPROM_READ(currents); if (!validating) { - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) SET_CURR(X); #endif - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) SET_CURR(Y); #endif - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) SET_CURR(Z); #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) SET_CURR(X2); #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) SET_CURR(Y2); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) SET_CURR(Z2); #endif - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) SET_CURR(E0); #endif - #if E1_IS_TRINAMIC + #if AXIS_IS_TMC(E1) SET_CURR(E1); #endif - #if E2_IS_TRINAMIC + #if AXIS_IS_TMC(E2) SET_CURR(E2); #endif - #if E3_IS_TRINAMIC + #if AXIS_IS_TMC(E3) SET_CURR(E3); #endif - #if E4_IS_TRINAMIC + #if AXIS_IS_TMC(E4) SET_CURR(E4); #endif } @@ -1355,37 +1355,37 @@ void MarlinSettings::postprocess() { uint32_t tmc_hybrid_threshold[TMC_AXES]; EEPROM_READ(tmc_hybrid_threshold); if (!validating) { - #if X_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(X) TMC_SET_PWMTHRS(X, X); #endif - #if Y_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Y) TMC_SET_PWMTHRS(Y, Y); #endif - #if Z_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Z) TMC_SET_PWMTHRS(Z, Z); #endif - #if X2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(X2) TMC_SET_PWMTHRS(X, X2); #endif - #if Y2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Y2) TMC_SET_PWMTHRS(Y, Y2); #endif - #if Z2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(Z2) TMC_SET_PWMTHRS(Z, Z2); #endif - #if E0_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E0) TMC_SET_PWMTHRS(E, E0); #endif - #if E1_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E1) TMC_SET_PWMTHRS(E, E1); #endif - #if E2_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E2) TMC_SET_PWMTHRS(E, E2); #endif - #if E3_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E3) TMC_SET_PWMTHRS(E, E3); #endif - #if E4_IS_TRINAMIC + #if AXIS_HAS_STEALTHCHOP(E4) TMC_SET_PWMTHRS(E, E4); #endif } @@ -1405,26 +1405,26 @@ void MarlinSettings::postprocess() { #if ENABLED(SENSORLESS_HOMING) if (!validating) { #ifdef X_HOMING_SENSITIVITY - #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) + #if AXIS_HAS_STALLGUARD(X) stepperX.sgt(tmc_sgt[0]); #endif - #if ENABLED(X2_IS_TMC2130) + #if AXIS_HAS_STALLGUARD(X2) stepperX2.sgt(tmc_sgt[0]); #endif #endif #ifdef Y_HOMING_SENSITIVITY - #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) + #if AXIS_HAS_STALLGUARD(Y) stepperY.sgt(tmc_sgt[1]); #endif - #if ENABLED(Y2_IS_TMC2130) + #if AXIS_HAS_STALLGUARD(Y2) stepperY2.sgt(tmc_sgt[1]); #endif #endif #ifdef Z_HOMING_SENSITIVITY - #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) + #if AXIS_HAS_STALLGUARD(Z) stepperZ.sgt(tmc_sgt[2]); #endif - #if ENABLED(Z2_IS_TMC2130) + #if AXIS_HAS_STALLGUARD(Z2) stepperZ2.sgt(tmc_sgt[2]); #endif #endif @@ -1733,7 +1733,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; #if ENABLED(JUNCTION_DEVIATION) - planner.junction_deviation_mm = JUNCTION_DEVIATION_MM; + planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); #else planner.max_jerk[X_AXIS] = DEFAULT_XJERK; planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; @@ -1835,7 +1835,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { HOTEND_LOOP() #endif { - PID_PARAM(Kp, e) = DEFAULT_Kp; + PID_PARAM(Kp, e) = float(DEFAULT_Kp); PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki); PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd); #if ENABLED(PID_EXTRUSION_SCALING) @@ -1904,7 +1904,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t e = 0; e < E_STEPPERS; e++) { + for (uint8_t e = 0; e < EXTRUDERS; e++) { filament_change_unload_length[e] = FILAMENT_CHANGE_UNLOAD_LENGTH; filament_change_load_length[e] = FILAMENT_CHANGE_FAST_LOAD_LENGTH; } @@ -2237,8 +2237,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { SERIAL_ECHOLNPGM_P(port, " meshes.\n"); } - ubl.report_current_mesh(PORTVAR_SOLO); - +// ubl.report_current_mesh(PORTVAR_SOLO); // This is too verbose for large mesh's. A better (more terse) + // solution needs to be found. #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) if (leveling_is_valid()) { @@ -2445,61 +2445,61 @@ void MarlinSettings::reset(PORTARG_SOLO) { #if HAS_TRINAMIC /** - * TMC2130 / TMC2208 / TRAMS stepper driver current + * TMC2130 / TMC2208 stepper driver current */ if (!forReplay) { CONFIG_ECHO_START; SERIAL_ECHOLNPGM_P(port, "Stepper driver current:"); } CONFIG_ECHO_START; - #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC + #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) say_M906(PORTVAR_SOLO); #endif - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) SERIAL_ECHOPAIR_P(port, " X", stepperX.getCurrent()); #endif - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) SERIAL_ECHOPAIR_P(port, " Y", stepperY.getCurrent()); #endif - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) SERIAL_ECHOPAIR_P(port, " Z", stepperZ.getCurrent()); #endif - #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC + #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) SERIAL_EOL_P(port); #endif - #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) say_M906(PORTVAR_SOLO); SERIAL_ECHOPGM_P(port, " I1"); #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) SERIAL_ECHOPAIR_P(port, " X", stepperX2.getCurrent()); #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) SERIAL_ECHOPAIR_P(port, " Y", stepperY2.getCurrent()); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) SERIAL_ECHOPAIR_P(port, " Z", stepperZ2.getCurrent()); #endif - #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) SERIAL_EOL_P(port); #endif - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) say_M906(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T0 E", stepperE0.getCurrent()); #endif - #if E_STEPPERS > 1 && E1_IS_TRINAMIC + #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) say_M906(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T1 E", stepperE1.getCurrent()); #endif - #if E_STEPPERS > 2 && E2_IS_TRINAMIC + #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) say_M906(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T2 E", stepperE2.getCurrent()); #endif - #if E_STEPPERS > 3 && E3_IS_TRINAMIC + #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) say_M906(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T3 E", stepperE3.getCurrent()); #endif - #if E_STEPPERS > 4 && E4_IS_TRINAMIC + #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) say_M906(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T4 E", stepperE4.getCurrent()); #endif @@ -2514,54 +2514,54 @@ void MarlinSettings::reset(PORTARG_SOLO) { SERIAL_ECHOLNPGM_P(port, "Hybrid Threshold:"); } CONFIG_ECHO_START; - #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC + #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) say_M913(PORTVAR_SOLO); #endif - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X)); #endif - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y)); #endif - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z)); #endif - #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC + #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) SERIAL_EOL_P(port); #endif - #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) say_M913(PORTVAR_SOLO); SERIAL_ECHOPGM_P(port, " I1"); #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X2)); #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y2)); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z2)); #endif - #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) SERIAL_EOL_P(port); #endif - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) say_M913(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T0 E", TMC_GET_PWMTHRS(E, E0)); #endif - #if E_STEPPERS > 1 && E1_IS_TRINAMIC + #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) say_M913(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T1 E", TMC_GET_PWMTHRS(E, E1)); #endif - #if E_STEPPERS > 2 && E2_IS_TRINAMIC + #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) say_M913(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T2 E", TMC_GET_PWMTHRS(E, E2)); #endif - #if E_STEPPERS > 3 && E3_IS_TRINAMIC + #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) say_M913(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T3 E", TMC_GET_PWMTHRS(E, E3)); #endif - #if E_STEPPERS > 4 && E4_IS_TRINAMIC + #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) say_M913(PORTVAR_SOLO); SERIAL_ECHOLNPAIR_P(port, " T4 E", TMC_GET_PWMTHRS(E, E4)); #endif @@ -2577,26 +2577,23 @@ void MarlinSettings::reset(PORTARG_SOLO) { SERIAL_ECHOLNPGM_P(port, "Sensorless homing threshold:"); } CONFIG_ECHO_START; - #define HAS_X_SENSORLESS (defined(X_HOMING_SENSITIVITY) && (ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS))) - #define HAS_Y_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && (ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS))) - #define HAS_Z_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && (ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS))) - #if HAS_X_SENSORLESS || HAS_Y_SENSORLESS || HAS_Z_SENSORLESS + #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS say_M914(PORTVAR_SOLO); - #if HAS_X_SENSORLESS + #if X_SENSORLESS SERIAL_ECHOPAIR_P(port, " X", stepperX.sgt()); #endif - #if HAS_Y_SENSORLESS + #if Y_SENSORLESS SERIAL_ECHOPAIR_P(port, " Y", stepperY.sgt()); #endif - #if HAS_Z_SENSORLESS + #if Z_SENSORLESS SERIAL_ECHOPAIR_P(port, " Z", stepperZ.sgt()); #endif SERIAL_EOL_P(port); #endif - #define HAS_X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && ENABLED(X2_IS_TMC2130)) - #define HAS_Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && ENABLED(Y2_IS_TMC2130)) - #define HAS_Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && ENABLED(Z2_IS_TMC2130)) + #define HAS_X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2)) + #define HAS_Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2)) + #define HAS_Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)) #if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS say_M914(PORTVAR_SOLO); SERIAL_ECHOPGM_P(port, " I1"); diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index dded33f9fd..308eed106f 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -90,31 +90,8 @@ void recalc_delta_settings() { * * - Disable the home_offset (M206) and/or position_shift (G92) * features to remove up to 12 float additions. - * - * - Use a fast-inverse-sqrt function and add the reciprocal. - * (see above) */ -#if ENABLED(DELTA_FAST_SQRT) && defined(__AVR__) - /** - * Fast inverse sqrt from Quake III Arena - * See: https://en.wikipedia.org/wiki/Fast_inverse_square_root - */ - float Q_rsqrt(float number) { - long i; - float x2, y; - const float threehalfs = 1.5f; - x2 = number * 0.5f; - y = number; - i = * ( long * ) &y; // evil floating point bit level hacking - i = 0x5F3759DF - ( i >> 1 ); // what the f***? - y = * ( float * ) &i; - y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration - // y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed - return y; - } -#endif - #define DELTA_DEBUG(VAR) do { \ SERIAL_ECHOPAIR("cartesian X:", VAR[X_AXIS]); \ SERIAL_ECHOPAIR(" Y:", VAR[Y_AXIS]); \ @@ -178,55 +155,55 @@ float delta_safe_distance_from_top() { * * The result is stored in the cartes[] array. */ -void forward_kinematics_DELTA(float z1, float z2, float z3) { +void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) { // Create a vector in old coordinates along x axis of new coordinate - float p12[3] = { delta_tower[B_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[B_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z2 - z1 }; + const float p12[3] = { delta_tower[B_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[B_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z2 - z1 }, - // Get the Magnitude of vector. - float d = SQRT( sq(p12[0]) + sq(p12[1]) + sq(p12[2]) ); + // Get the reciprocal of Magnitude of vector. + d2 = sq(p12[0]) + sq(p12[1]) + sq(p12[2]), inv_d = RSQRT(d2), - // Create unit vector by dividing by magnitude. - float ex[3] = { p12[0] / d, p12[1] / d, p12[2] / d }; + // Create unit vector by multiplying by the inverse of the magnitude. + ex[3] = { p12[0] * inv_d, p12[1] * inv_d, p12[2] * inv_d }, // Get the vector from the origin of the new system to the third point. - float p13[3] = { delta_tower[C_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[C_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z3 - z1 }; + p13[3] = { delta_tower[C_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[C_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z3 - z1 }, // Use the dot product to find the component of this vector on the X axis. - float i = ex[0] * p13[0] + ex[1] * p13[1] + ex[2] * p13[2]; + i = ex[0] * p13[0] + ex[1] * p13[1] + ex[2] * p13[2], // Create a vector along the x axis that represents the x component of p13. - float iex[3] = { ex[0] * i, ex[1] * i, ex[2] * i }; + iex[3] = { ex[0] * i, ex[1] * i, ex[2] * i }; // Subtract the X component from the original vector leaving only Y. We use the // variable that will be the unit vector after we scale it. float ey[3] = { p13[0] - iex[0], p13[1] - iex[1], p13[2] - iex[2] }; - // The magnitude of Y component - float j = SQRT( sq(ey[0]) + sq(ey[1]) + sq(ey[2]) ); + // The magnitude and the inverse of the magnitude of Y component + const float j2 = sq(ey[0]) + sq(ey[1]) + sq(ey[2]), inv_j = RSQRT(j2); // Convert to a unit vector - ey[0] /= j; ey[1] /= j; ey[2] /= j; + ey[0] *= inv_j; ey[1] *= inv_j; ey[2] *= inv_j; // The cross product of the unit x and y is the unit z // float[] ez = vectorCrossProd(ex, ey); - float ez[3] = { + const float ez[3] = { ex[1] * ey[2] - ex[2] * ey[1], ex[2] * ey[0] - ex[0] * ey[2], ex[0] * ey[1] - ex[1] * ey[0] - }; + }, // We now have the d, i and j values defined in Wikipedia. // Plug them into the equations defined in Wikipedia for Xnew, Ynew and Znew - float Xnew = (delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[B_AXIS] + sq(d)) / (d * 2), - Ynew = ((delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[C_AXIS] + HYPOT2(i, j)) / 2 - i * Xnew) / j, - Znew = SQRT(delta_diagonal_rod_2_tower[A_AXIS] - HYPOT2(Xnew, Ynew)); + Xnew = (delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[B_AXIS] + d2) * inv_d * 0.5, + Ynew = ((delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[C_AXIS] + sq(i) + j2) * 0.5 - i * Xnew) * inv_j, + Znew = SQRT(delta_diagonal_rod_2_tower[A_AXIS] - HYPOT2(Xnew, Ynew)); // Start from the origin of the old coordinates and add vectors in the // old coords that represent the Xnew, Ynew and Znew to find the point // in the old system. cartes[X_AXIS] = delta_tower[A_AXIS][X_AXIS] + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew; cartes[Y_AXIS] = delta_tower[A_AXIS][Y_AXIS] + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew; - cartes[Z_AXIS] = z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew; + cartes[Z_AXIS] = z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew; } #if ENABLED(SENSORLESS_HOMING) @@ -241,7 +218,7 @@ void forward_kinematics_DELTA(float z1, float z2, float z3) { * A delta can only safely home all axes at the same time * This is like quick_home_xy() but for 3 towers. */ -bool home_delta() { +void home_delta() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position); #endif @@ -265,22 +242,13 @@ bool home_delta() { delta_sensorless_homing(false); #endif - // If an endstop was not hit, then damage can occur if homing is continued. - // This can occur if the delta height not set correctly. - if (!(endstops.trigger_state() & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) { - LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED); - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED); - return false; - } - - endstops.hit_on_purpose(); // clear endstop hit flags + endstops.validate_homing_move(); // At least one carriage has reached the top. // Now re-home each carriage separately. - HOMEAXIS(A); - HOMEAXIS(B); - HOMEAXIS(C); + homeaxis(A_AXIS); + homeaxis(B_AXIS); + homeaxis(C_AXIS); // Set all carriages to their home positions // Do this here all at once for Delta, because @@ -293,8 +261,6 @@ bool home_delta() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position); #endif - - return true; } #endif // DELTA diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index 59c01981fc..2dde72f801 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -64,26 +64,15 @@ void recalc_delta_settings(); * (see above) */ -#if ENABLED(DELTA_FAST_SQRT) && defined(__AVR__) - /** - * Fast inverse sqrt from Quake III Arena - * See: https://en.wikipedia.org/wiki/Fast_inverse_square_root - */ - float Q_rsqrt(float number); - #define _SQRT(n) (1.0f / Q_rsqrt(n)) -#else - #define _SQRT(n) SQRT(n) -#endif - // Macro to obtain the Z position of an individual tower -#define DELTA_Z(V,T) V[Z_AXIS] + _SQRT( \ +#define DELTA_Z(V,T) V[Z_AXIS] + SQRT( \ delta_diagonal_rod_2_tower[T] - HYPOT2( \ delta_tower[T][X_AXIS] - V[X_AXIS], \ delta_tower[T][Y_AXIS] - V[Y_AXIS] \ ) \ ) -#define DELTA_IK(V) do { \ +#define DELTA_IK(V) do { \ delta[A_AXIS] = DELTA_Z(V, A_AXIS); \ delta[B_AXIS] = DELTA_Z(V, B_AXIS); \ delta[C_AXIS] = DELTA_Z(V, C_AXIS); \ @@ -122,12 +111,12 @@ float delta_safe_distance_from_top(); * * The result is stored in the cartes[] array. */ -void forward_kinematics_DELTA(float z1, float z2, float z3); +void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3); -FORCE_INLINE void forward_kinematics_DELTA(float point[ABC]) { +FORCE_INLINE void forward_kinematics_DELTA(const float (&point)[ABC]) { forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]); } -bool home_delta(); +void home_delta(); #endif // __DELTA_H__ diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 0b3baf5dc2..cecd303531 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -216,7 +216,7 @@ void Endstops::init() { } // Endstops::init -// Called from ISR: Poll endstop state if required +// Called at ~1KHz from Temperature ISR: Poll endstop state if required void Endstops::poll() { #if ENABLED(PINS_DEBUGGING) @@ -256,6 +256,12 @@ void Endstops::not_homing() { #endif } +// If the last move failed to trigger an endstop, call kill +void Endstops::validate_homing_move() { + if (trigger_state()) hit_on_purpose(); + else kill(PSTR(MSG_ERR_HOMING_FAILED)); +} + // Enable / disable endstop z-probe checking #if HAS_BED_PROBE void Endstops::enable_z_probe(const bool onoff) { @@ -277,8 +283,9 @@ void Endstops::not_homing() { } #endif -void Endstops::report_state() { - if (hit_state) { +void Endstops::event_handler() { + static uint8_t prev_hit_state; // = 0 + if (hit_state && hit_state != prev_hit_state) { #if ENABLED(ULTRA_LCD) char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; #define _SET_STOP_CHAR(A,C) (chr## A = C) @@ -314,8 +321,6 @@ void Endstops::report_state() { lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); #endif - hit_on_purpose(); - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT) if (planner.abort_on_endstop_hit) { card.sdprinting = false; @@ -325,6 +330,7 @@ void Endstops::report_state() { } #endif } + prev_hit_state = hit_state; } // Endstops::report_state void Endstops::M119() { @@ -386,7 +392,7 @@ void Endstops::M119() { #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING -// Check endstops - Could be called from ISR! +// Check endstops - Could be called from Temperature ISR! void Endstops::update() { #if DISABLED(ENDSTOP_NOISE_FILTER) @@ -429,109 +435,94 @@ void Endstops::update() { #endif /** - * Check and update endstops according to conditions + * Check and update endstops */ - if (stepper.axis_is_moving(X_AXIS)) { - if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction - #if HAS_X_MIN - #if ENABLED(X_DUAL_ENDSTOPS) && X_HOME_DIR < 0 - UPDATE_ENDSTOP_BIT(X, MIN); - #if HAS_X2_MIN - UPDATE_ENDSTOP_BIT(X2, MIN); - #else - COPY_LIVE_STATE(X_MIN, X2_MIN); - #endif - #else - if (X_MIN_TEST) UPDATE_ENDSTOP_BIT(X, MIN); - #endif - #endif - } - else { // +direction - #if HAS_X_MAX - #if ENABLED(X_DUAL_ENDSTOPS) && X_HOME_DIR > 0 - UPDATE_ENDSTOP_BIT(X, MAX); - #if HAS_X2_MAX - UPDATE_ENDSTOP_BIT(X2, MAX); - #else - COPY_LIVE_STATE(X_MAX, X2_MAX); - #endif - #else - if (X_MAX_TEST) UPDATE_ENDSTOP_BIT(X, MAX); - #endif + #if HAS_X_MIN + #if ENABLED(X_DUAL_ENDSTOPS) + UPDATE_ENDSTOP_BIT(X, MIN); + #if HAS_X2_MIN + UPDATE_ENDSTOP_BIT(X2, MIN); + #else + COPY_LIVE_STATE(X_MIN, X2_MIN); #endif - } - } + #else + UPDATE_ENDSTOP_BIT(X, MIN); + #endif + #endif - if (stepper.axis_is_moving(Y_AXIS)) { - if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction - #if HAS_Y_MIN && Y_HOME_DIR < 0 - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MIN); - #if HAS_Y2_MIN - UPDATE_ENDSTOP_BIT(Y2, MIN); - #else - COPY_LIVE_STATE(Y_MIN, Y2_MIN); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MIN); - #endif + #if HAS_X_MAX + #if ENABLED(X_DUAL_ENDSTOPS) + UPDATE_ENDSTOP_BIT(X, MAX); + #if HAS_X2_MAX + UPDATE_ENDSTOP_BIT(X2, MAX); + #else + COPY_LIVE_STATE(X_MAX, X2_MAX); #endif - } - else { // +direction - #if HAS_Y_MAX && Y_HOME_DIR > 0 - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MAX); - #if HAS_Y2_MAX - UPDATE_ENDSTOP_BIT(Y2, MAX); - #else - COPY_LIVE_STATE(Y_MAX, Y2_MAX); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MAX); - #endif + #else + UPDATE_ENDSTOP_BIT(X, MAX); + #endif + #endif + + #if HAS_Y_MIN + #if ENABLED(Y_DUAL_ENDSTOPS) + UPDATE_ENDSTOP_BIT(Y, MIN); + #if HAS_Y2_MIN + UPDATE_ENDSTOP_BIT(Y2, MIN); + #else + COPY_LIVE_STATE(Y_MIN, Y2_MIN); #endif - } - } + #else + UPDATE_ENDSTOP_BIT(Y, MIN); + #endif + #endif - if (stepper.axis_is_moving(Z_AXIS)) { - if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. - #if HAS_Z_MIN - #if ENABLED(Z_DUAL_ENDSTOPS) && Z_HOME_DIR < 0 - UPDATE_ENDSTOP_BIT(Z, MIN); - #if HAS_Z2_MIN - UPDATE_ENDSTOP_BIT(Z2, MIN); - #else - COPY_LIVE_STATE(Z_MIN, Z2_MIN); - #endif - #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - if (z_probe_enabled) UPDATE_ENDSTOP_BIT(Z, MIN); - #elif Z_HOME_DIR < 0 - UPDATE_ENDSTOP_BIT(Z, MIN); - #endif + #if HAS_Y_MAX + #if ENABLED(Y_DUAL_ENDSTOPS) + UPDATE_ENDSTOP_BIT(Y, MAX); + #if HAS_Y2_MAX + UPDATE_ENDSTOP_BIT(Y2, MAX); + #else + COPY_LIVE_STATE(Y_MAX, Y2_MAX); #endif + #else + UPDATE_ENDSTOP_BIT(Y, MAX); + #endif + #endif - // When closing the gap check the enabled probe - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - if (z_probe_enabled) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); + #if HAS_Z_MIN + #if ENABLED(Z_DUAL_ENDSTOPS) + UPDATE_ENDSTOP_BIT(Z, MIN); + #if HAS_Z2_MIN + UPDATE_ENDSTOP_BIT(Z2, MIN); + #else + COPY_LIVE_STATE(Z_MIN, Z2_MIN); #endif - } - else { // Z +direction. Gantry up, bed down. - #if HAS_Z_MAX && Z_HOME_DIR > 0 - // Check both Z dual endstops - #if ENABLED(Z_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Z, MAX); - #if HAS_Z2_MAX - UPDATE_ENDSTOP_BIT(Z2, MAX); - #else - COPY_LIVE_STATE(Z_MAX, Z2_MAX); - #endif - #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin isn't the bed probe it's the Z endstop - UPDATE_ENDSTOP_BIT(Z, MAX); - #endif + #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + UPDATE_ENDSTOP_BIT(Z, MIN); + #elif Z_HOME_DIR < 0 + UPDATE_ENDSTOP_BIT(Z, MIN); + #endif + #endif + + // When closing the gap check the enabled probe + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); + #endif + + #if HAS_Z_MAX + // Check both Z dual endstops + #if ENABLED(Z_DUAL_ENDSTOPS) + UPDATE_ENDSTOP_BIT(Z, MAX); + #if HAS_Z2_MAX + UPDATE_ENDSTOP_BIT(Z2, MAX); + #else + COPY_LIVE_STATE(Z_MAX, Z2_MAX); #endif - } - } + #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN + // If this pin isn't the bed probe it's the Z endstop + UPDATE_ENDSTOP_BIT(Z, MAX); + #endif + #endif #if ENABLED(ENDSTOP_NOISE_FILTER) /** @@ -576,7 +567,7 @@ void Endstops::update() { if (dual_hit) { \ _ENDSTOP_HIT(AXIS1, MINMAX); \ /* if not performing home or if both endstops were trigged during homing... */ \ - if (!stepper.homing_dual_axis || dual_hit == 0x3) \ + if (!stepper.homing_dual_axis || dual_hit == 0b11) \ planner.endstop_triggered(_AXIS(AXIS1)); \ } \ }while(0) @@ -644,6 +635,8 @@ void Endstops::update() { #else #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); + #elif ENABLED(Z_MIN_PROBE_ENDSTOP) + if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); #else PROCESS_ENDSTOP(Z, MIN); #endif diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 830b1515b1..a72c9cfd9c 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -73,7 +73,6 @@ class Endstops { #if ENABLED(ENDSTOP_NOISE_FILTER) static esbits_t validated_live_state; - uint8_t Endstops::endstop_poll_count; static uint8_t endstop_poll_count; // Countdown from threshold for polling #endif @@ -129,7 +128,7 @@ class Endstops { /** * Report endstop hits to serial. Called from loop(). */ - static void report_state(); + static void event_handler(); /** * Report endstop positions in response to M119 @@ -145,6 +144,9 @@ class Endstops { // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable static void not_homing(); + // If the last move failed to trigger an endstop, call kill + static void validate_homing_move(); + // Clear endstops (i.e., they were hit intentionally) to suppress the report FORCE_INLINE static void hit_on_purpose() { hit_state = 0; } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index e8e3ee5bb7..864d04609b 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -77,7 +77,7 @@ bool relative_mode; // = false; * Used by 'buffer_line_to_current_position' to do a move after changing it. * Used by 'SYNC_PLAN_POSITION_KINEMATIC' to update 'planner.position'. */ -float current_position[XYZE] = { 0.0 }; +float current_position[XYZE] = { 0 }; /** * Cartesian Destination @@ -85,7 +85,7 @@ float current_position[XYZE] = { 0.0 }; * and expected by functions like 'prepare_move_to_destination'. * Set with 'get_destination_from_command' or 'set_destination_from_current'. */ -float destination[XYZE] = { 0.0 }; +float destination[XYZE] = { 0 }; // The active extruder (tool). Set with T command. @@ -100,7 +100,7 @@ uint8_t active_extruder; // = 0; // no other feedrate is specified. Overridden for special moves. // Set by the last G0 through G5 command's "F" parameter. // Functions that override this for custom moves *must always* restore it! -float feedrate_mm_s = MMM_TO_MMS(1500.0); +float feedrate_mm_s = MMM_TO_MMS(1500.0f); int16_t feedrate_percentage = 100; @@ -509,7 +509,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, * but may produce jagged lines. Try 0.5mm, 1.0mm, and 2.0mm * and compare the difference. */ - #define SCARA_MIN_SEGMENT_LENGTH 0.5 + #define SCARA_MIN_SEGMENT_LENGTH 0.5f #endif /** @@ -566,14 +566,14 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, // For SCARA enforce a minimum segment size #if IS_SCARA - NOMORE(segments, cartesian_mm * (1.0 / SCARA_MIN_SEGMENT_LENGTH)); + NOMORE(segments, cartesian_mm * (1.0f / float(SCARA_MIN_SEGMENT_LENGTH))); #endif // At least one segment is required NOLESS(segments, 1U); // The approximate length of each segment - const float inv_segments = 1.0 / float(segments), + const float inv_segments = 1.0f / float(segments), segment_distance[XYZE] = { xdiff * inv_segments, ydiff * inv_segments, @@ -581,7 +581,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, ediff * inv_segments }; - #if DISABLED(SCARA_FEEDRATE_SCALING) + #if !HAS_FEEDRATE_SCALING const float cartesian_segment_mm = cartesian_mm * inv_segments; #endif @@ -589,22 +589,25 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, SERIAL_ECHOPAIR("mm=", cartesian_mm); SERIAL_ECHOPAIR(" seconds=", seconds); SERIAL_ECHOPAIR(" segments=", segments); - #if DISABLED(SCARA_FEEDRATE_SCALING) - SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm); - #else - SERIAL_EOL(); + #if !HAS_FEEDRATE_SCALING + SERIAL_ECHOPAIR(" segment_mm=", cartesian_segment_mm); #endif + SERIAL_EOL(); //*/ - #if ENABLED(SCARA_FEEDRATE_SCALING) + #if HAS_FEEDRATE_SCALING // SCARA needs to scale the feed rate from mm/s to degrees/s // i.e., Complete the angular vector in the given time. const float segment_length = cartesian_mm * inv_segments, - inv_segment_length = 1.0 / segment_length, // 1/mm/segs + inv_segment_length = 1.0f / segment_length, // 1/mm/segs inverse_secs = inv_segment_length * _feedrate_mm_s; float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS]; + oldB = planner.position_float[B_AXIS] + #if ENABLED(DELTA_FEEDRATE_SCALING) + , oldC = planner.position_float[C_AXIS] + #endif + ; /* SERIAL_ECHOPGM("Scaled kinematic move: "); @@ -613,7 +616,11 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, SERIAL_ECHOPAIR(") _feedrate_mm_s=", _feedrate_mm_s); SERIAL_ECHOPAIR(" inverse_secs=", inverse_secs); SERIAL_ECHOPAIR(" oldA=", oldA); - SERIAL_ECHOLNPAIR(" oldB=", oldB); + SERIAL_ECHOPAIR(" oldB=", oldB); + #if ENABLED(DELTA_FEEDRATE_SCALING) + SERIAL_ECHOPAIR(" oldC=", oldC); + #endif + SERIAL_EOL(); safe_delay(5); //*/ #endif @@ -654,6 +661,19 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, safe_delay(5); //*/ oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; + #elif ENABLED(DELTA_FEEDRATE_SCALING) + // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s + // i.e., Complete the linear vector in the given time. + if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder)) + break; + /* + SERIAL_ECHO(segments); + SERIAL_ECHOPAIR(": X=", raw[X_AXIS]); SERIAL_ECHOPAIR(" Y=", raw[Y_AXIS]); + SERIAL_ECHOPAIR(" A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); + SERIAL_ECHOLNPAIR(" F", SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs * 60); + safe_delay(5); + //*/ + oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; #else if (!planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder, cartesian_segment_mm)) break; @@ -661,17 +681,31 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, } // Ensure last segment arrives at target location. - #if ENABLED(SCARA_FEEDRATE_SCALING) + #if HAS_FEEDRATE_SCALING inverse_kinematics(rtarget); ADJUST_DELTA(rtarget); + #endif + + #if ENABLED(SCARA_FEEDRATE_SCALING) const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); if (diff2) { planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - /* SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); - SERIAL_ECHOLNPAIR(" F", (SQRT(diff2) * inverse_secs) * 60); + SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); + SERIAL_EOL(); + safe_delay(5); + //*/ + } + #elif ENABLED(DELTA_FEEDRATE_SCALING) + const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); + if (diff2) { + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], rtarget[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); + /* + SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); + SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); SERIAL_ECHOPAIR(" cdiff=", delta[C_AXIS] - oldC); + SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); SERIAL_EOL(); safe_delay(5); //*/ @@ -722,7 +756,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, NOLESS(segments, 1U); // The approximate length of each segment - const float inv_segments = 1.0 / float(segments), + const float inv_segments = 1.0f / float(segments), cartesian_segment_mm = cartesian_mm * inv_segments, segment_distance[XYZE] = { xdiff * inv_segments, @@ -1083,16 +1117,9 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa if (is_home_dir) { - if (axis == Z_AXIS) { - #if HOMING_Z_WITH_PROBE - #if ENABLED(BLTOUCH) - set_bltouch_deployed(true); - #endif - #if QUIET_PROBING - probing_pause(true); - #endif - #endif - } + #if HOMING_Z_WITH_PROBE && QUIET_PROBING + if (axis == Z_AXIS) probing_pause(true); + #endif // Disable stealthChop if used. Enable diag1 pin on driver. #if ENABLED(SENSORLESS_HOMING) @@ -1118,18 +1145,11 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa if (is_home_dir) { - if (axis == Z_AXIS) { - #if HOMING_Z_WITH_PROBE - #if QUIET_PROBING - probing_pause(false); - #endif - #if ENABLED(BLTOUCH) - set_bltouch_deployed(false); - #endif - #endif - } + #if HOMING_Z_WITH_PROBE && QUIET_PROBING + if (axis == Z_AXIS) probing_pause(false); + #endif - endstops.hit_on_purpose(); + endstops.validate_homing_move(); // Re-enable stealthChop if used. Disable diag1 pin on driver. #if ENABLED(SENSORLESS_HOMING) @@ -1301,7 +1321,18 @@ void homeaxis(const AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:"); #endif - do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir); + + #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) + // BLTOUCH needs to be deployed every time + if (axis == Z_AXIS && set_bltouch_deployed(true)) return; + #endif + + do_homing_move(axis, 1.5f * max_length(axis) * axis_home_dir); + + #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) + // BLTOUCH needs to be stowed after trigger to rearm itself + if (axis == Z_AXIS) set_bltouch_deployed(false); + #endif // When homing Z with probe respect probe clearance const float bump = axis_home_dir * ( @@ -1327,7 +1358,18 @@ void homeaxis(const AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 2 Slow:"); #endif + + #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) + // BLTOUCH needs to be deployed every time + if (axis == Z_AXIS && set_bltouch_deployed(true)) return; + #endif + do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); + + #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) + // BLTOUCH needs to be stowed after trigger to rearm itself + if (axis == Z_AXIS) set_bltouch_deployed(false); + #endif } #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) @@ -1335,28 +1377,34 @@ void homeaxis(const AxisEnum axis) { #if ENABLED(X_DUAL_ENDSTOPS) if (axis == X_AXIS) { const float adj = ABS(endstops.x_endstop_adj); - if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_x_lock(false); - stepper.set_x2_lock(false); + if (adj) { + if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true); + do_homing_move(axis, pos_dir ? -adj : adj); + stepper.set_x_lock(false); + stepper.set_x2_lock(false); + } } #endif #if ENABLED(Y_DUAL_ENDSTOPS) if (axis == Y_AXIS) { const float adj = ABS(endstops.y_endstop_adj); - if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_y_lock(false); - stepper.set_y2_lock(false); + if (adj) { + if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true); + do_homing_move(axis, pos_dir ? -adj : adj); + stepper.set_y_lock(false); + stepper.set_y2_lock(false); + } } #endif #if ENABLED(Z_DUAL_ENDSTOPS) if (axis == Z_AXIS) { const float adj = ABS(endstops.z_endstop_adj); - if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_z_lock(false); - stepper.set_z2_lock(false); + if (adj) { + if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true); + do_homing_move(axis, pos_dir ? -adj : adj); + stepper.set_z_lock(false); + stepper.set_z2_lock(false); + } } #endif stepper.set_homing_dual_axis(false); @@ -1435,7 +1483,7 @@ void homeaxis(const AxisEnum axis) { if (axis == X_AXIS) { // In Dual X mode hotend_offset[X] is T1's home position - float dual_max_x = MAX(hotend_offset[X_AXIS][1], X2_MAX_POS); + const float dual_max_x = MAX(hotend_offset[X_AXIS][1], X2_MAX_POS); if (active_extruder != 0) { // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger) diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index e06474654d..78646a9f45 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -71,7 +71,7 @@ extern float feedrate_mm_s; * Feedrate scaling and conversion */ extern int16_t feedrate_percentage; -#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01) +#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01f) extern uint8_t active_extruder; @@ -141,7 +141,7 @@ void line_to_current_position(); void buffer_line_to_destination(const float fr_mm_s); #if IS_KINEMATIC - void prepare_uninterpolated_move_to_destination(const float fr_mm_s=0.0); + void prepare_uninterpolated_move_to_destination(const float fr_mm_s=0); #endif void prepare_move_to_destination(); @@ -149,10 +149,10 @@ void prepare_move_to_destination(); /** * Blocking movement and shorthand functions */ -void do_blocking_move_to(const float rx, const float ry, const float rz, const float &fr_mm_s=0.0); -void do_blocking_move_to_x(const float &rx, const float &fr_mm_s=0.0); -void do_blocking_move_to_z(const float &rz, const float &fr_mm_s=0.0); -void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm_s=0.0); +void do_blocking_move_to(const float rx, const float ry, const float rz, const float &fr_mm_s=0); +void do_blocking_move_to_x(const float &rx, const float &fr_mm_s=0); +void do_blocking_move_to_z(const float &rz, const float &fr_mm_s=0); +void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm_s=0); void setup_for_endstop_or_probe_move(); void clean_up_after_endstop_or_probe_move(); @@ -189,7 +189,6 @@ void clean_up_after_endstop_or_probe_move(); void set_axis_is_at_home(const AxisEnum axis); void homeaxis(const AxisEnum axis); -#define HOMEAXIS(A) homeaxis(_AXIS(A)) #if ENABLED(SENSORLESS_HOMING) void sensorless_homing_per_axis(const AxisEnum axis, const bool enable=true); @@ -269,8 +268,8 @@ void homeaxis(const AxisEnum axis); // Return true if the given position is within the machine bounds. inline bool position_is_reachable(const float &rx, const float &ry) { // Add 0.001 margin to deal with float imprecision - return WITHIN(rx, X_MIN_POS - 0.001, X_MAX_POS + 0.001) - && WITHIN(ry, Y_MIN_POS - 0.001, Y_MAX_POS + 0.001); + return WITHIN(rx, X_MIN_POS - 0.001f, X_MAX_POS + 0.001f) + && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f); } #if HAS_BED_PROBE @@ -283,8 +282,8 @@ void homeaxis(const AxisEnum axis); */ inline bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER)) - && WITHIN(rx, MIN_PROBE_X - 0.001, MAX_PROBE_X + 0.001) - && WITHIN(ry, MIN_PROBE_Y - 0.001, MAX_PROBE_Y + 0.001); + && WITHIN(rx, MIN_PROBE_X - 0.001f, MAX_PROBE_X + 0.001f) + && WITHIN(ry, MIN_PROBE_Y - 0.001f, MAX_PROBE_Y + 0.001f); } #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 9083c77594..c93d811271 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -104,11 +104,12 @@ Planner planner; * A ring buffer of moves described in steps */ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; -volatile uint8_t Planner::block_buffer_head, // Index of the next block to be pushed - Planner::block_buffer_tail; // Index of the busy block, if any -uint16_t Planner::cleaning_buffer_counter; // A counter to disable queuing of blocks -uint8_t Planner::delay_before_delivering, // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - Planner::block_buffer_planned; // Index of the optimally planned block +volatile uint8_t Planner::block_buffer_head, // Index of the next block to be pushed + Planner::block_buffer_nonbusy, // Index of the first non-busy block + Planner::block_buffer_planned, // Index of the optimally planned block + Planner::block_buffer_tail; // Index of the busy block, if any +uint16_t Planner::cleaning_buffer_counter; // A counter to disable queuing of blocks +uint8_t Planner::delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks uint32_t Planner::max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE Planner::max_acceleration_steps_per_s2[XYZE_N], // (steps/s^2) Derived from mm_per_s2 @@ -126,7 +127,11 @@ float Planner::max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds #if ENABLED(JUNCTION_DEVIATION) float Planner::junction_deviation_mm; // (mm) M205 J #if ENABLED(LIN_ADVANCE) - float Planner::max_e_jerk_factor; // Calculated from junction_deviation_mm + #if ENABLED(DISTINCT_E_FACTORS) + float Planner::max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm + #else + float Planner::max_e_jerk; + #endif #endif #else float Planner::max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. @@ -145,11 +150,11 @@ float Planner::max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder -float Planner::e_factor[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0); // The flow percentage and volumetric multiplier combine to scale E movement +float Planner::e_factor[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0f); // The flow percentage and volumetric multiplier combine to scale E movement #if DISABLED(NO_VOLUMETRICS) float Planner::filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder - Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area + Planner::volumetric_area_nominal = CIRCLE_AREA((float(DEFAULT_NOMINAL_FILAMENT_DIA)) * 0.5f), // Nominal cross-sectional area Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner #endif @@ -183,7 +188,7 @@ float Planner::e_factor[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0); // The flow perce #if ENABLED(AUTOTEMP) float Planner::autotemp_max = 250, Planner::autotemp_min = 210, - Planner::autotemp_factor = 0.1; + Planner::autotemp_factor = 0.1f; bool Planner::autotemp_enabled = false; #endif @@ -231,12 +236,11 @@ void Planner::init() { ZERO(position_float); #endif ZERO(previous_speed); - previous_nominal_speed_sqr = 0.0; + previous_nominal_speed_sqr = 0; #if ABL_PLANAR bed_level_matrix.set_to_identity(); #endif clear_block_buffer(); - block_buffer_planned = 0; delay_before_delivering = 0; } @@ -382,89 +386,89 @@ void Planner::init() { // use Newton-Raphson for the calculation, and will strive to get way less cycles // for the same result - Using C division, it takes 500cycles to complete . - A("clr %3") // idx = 0 + A("clr %3") // idx = 0 A("mov %14,%6") A("mov %15,%7") - A("mov %16,%8") // nr = interval - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this + A("mov %16,%8") // nr = interval + A("tst %16") // nr & 0xFF0000 == 0 ? + A("brne 2f") // No, skip this A("mov %16,%15") - A("mov %15,%14") // nr <<= 8, %14 not needed - A("subi %3,-8") // idx += 8 - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") // nr <<= 8, %14 not needed - A("clr %15") // We clear %14 - A("subi %3,-8") // idx += 8 + A("mov %15,%14") // nr <<= 8, %14 not needed + A("subi %3,-8") // idx += 8 + A("tst %16") // nr & 0xFF0000 == 0 ? + A("brne 2f") // No, skip this + A("mov %16,%15") // nr <<= 8, %14 not needed + A("clr %15") // We clear %14 + A("subi %3,-8") // idx += 8 // here %16 != 0 and %16:%15 contains at least 9 MSBits, or both %16:%15 are 0 L("2") - A("cpi %16,0x10") // (nr & 0xF00000) == 0 ? - A("brcc 3f") // No, skip this - A("swap %15") // Swap nibbles - A("swap %16") // Swap nibbles. Low nibble is 0 + A("cpi %16,0x10") // (nr & 0xF00000) == 0 ? + A("brcc 3f") // No, skip this + A("swap %15") // Swap nibbles + A("swap %16") // Swap nibbles. Low nibble is 0 A("mov %14, %15") - A("andi %14,0x0F") // Isolate low nibble - A("andi %15,0xF0") // Keep proper nibble in %15 - A("or %16, %14") // %16:%15 <<= 4 - A("subi %3,-4") // idx += 4 + A("andi %14,0x0F") // Isolate low nibble + A("andi %15,0xF0") // Keep proper nibble in %15 + A("or %16, %14") // %16:%15 <<= 4 + A("subi %3,-4") // idx += 4 L("3") - A("cpi %16,0x40") // (nr & 0xC00000) == 0 ? - A("brcc 4f") // No, skip this + A("cpi %16,0x40") // (nr & 0xC00000) == 0 ? + A("brcc 4f") // No, skip this A("add %15,%15") A("adc %16,%16") A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 2 - A("subi %3,-2") // idx += 2 + A("adc %16,%16") // %16:%15 <<= 2 + A("subi %3,-2") // idx += 2 L("4") - A("cpi %16,0x80") // (nr & 0x800000) == 0 ? - A("brcc 5f") // No, skip this + A("cpi %16,0x80") // (nr & 0x800000) == 0 ? + A("brcc 5f") // No, skip this A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 1 - A("inc %3") // idx += 1 + A("adc %16,%16") // %16:%15 <<= 1 + A("inc %3") // idx += 1 // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure // we have at least 9 MSBits available to enter the initial estimation table L("5") A("add %15,%15") - A("adc %16,%16") // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table) - A("add r30,%16") // Only use top 8 bits - A("adc r31,%13") // r31:r30 = inv_tab + (tidx) - A("lpm %14, Z") // %14 = inv_tab[tidx] - A("ldi %15, 1") // %15 = 1 %15:%14 = inv_tab[tidx] + 256 + A("adc %16,%16") // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table) + A("add r30,%16") // Only use top 8 bits + A("adc r31,%13") // r31:r30 = inv_tab + (tidx) + A("lpm %14, Z") // %14 = inv_tab[tidx] + A("ldi %15, 1") // %15 = 1 %15:%14 = inv_tab[tidx] + 256 // We must scale the approximation to the proper place - A("clr %16") // %16 will always be 0 here - A("subi %3,8") // idx == 8 ? - A("breq 6f") // yes, no need to scale - A("brcs 7f") // If C=1, means idx < 8, result was negative! + A("clr %16") // %16 will always be 0 here + A("subi %3,8") // idx == 8 ? + A("breq 6f") // yes, no need to scale + A("brcs 7f") // If C=1, means idx < 8, result was negative! // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8] - A("sbrs %3,0") // shift by 1bit position? - A("rjmp 8f") // No + A("sbrs %3,0") // shift by 1bit position? + A("rjmp 8f") // No A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 + A("adc %15,%15") // %15:16 <<= 1 L("8") - A("sbrs %3,1") // shift by 2bit position? - A("rjmp 9f") // No + A("sbrs %3,1") // shift by 2bit position? + A("rjmp 9f") // No A("add %14,%14") A("adc %15,%15") A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 + A("adc %15,%15") // %15:16 <<= 1 L("9") - A("sbrs %3,2") // shift by 4bits position? - A("rjmp 16f") // No - A("swap %15") // Swap nibbles. lo nibble of %15 will always be 0 - A("swap %14") // Swap nibbles + A("sbrs %3,2") // shift by 4bits position? + A("rjmp 16f") // No + A("swap %15") // Swap nibbles. lo nibble of %15 will always be 0 + A("swap %14") // Swap nibbles A("mov %12,%14") - A("andi %12,0x0F") // isolate low nibble - A("andi %14,0xF0") // and clear it - A("or %15,%12") // %15:%16 <<= 4 + A("andi %12,0x0F") // isolate low nibble + A("andi %14,0xF0") // and clear it + A("or %15,%12") // %15:%16 <<= 4 L("16") - A("sbrs %3,3") // shift by 8bits position? - A("rjmp 6f") // No, we are done + A("sbrs %3,3") // shift by 8bits position? + A("rjmp 6f") // No, we are done A("mov %16,%15") A("mov %15,%14") A("clr %14") @@ -472,32 +476,32 @@ void Planner::init() { // idx < 8, now %3 = idx - 8. Get the count of bits L("7") - A("neg %3") // %3 = -idx = count of bits to move right. idx range:[1...8] - A("sbrs %3,0") // shift by 1 bit position ? - A("rjmp 10f") // No, skip it - A("asr %15") // (bit7 is always 0 here) + A("neg %3") // %3 = -idx = count of bits to move right. idx range:[1...8] + A("sbrs %3,0") // shift by 1 bit position ? + A("rjmp 10f") // No, skip it + A("asr %15") // (bit7 is always 0 here) A("ror %14") L("10") - A("sbrs %3,1") // shift by 2 bit position ? - A("rjmp 11f") // No, skip it - A("asr %15") // (bit7 is always 0 here) + A("sbrs %3,1") // shift by 2 bit position ? + A("rjmp 11f") // No, skip it + A("asr %15") // (bit7 is always 0 here) A("ror %14") - A("asr %15") // (bit7 is always 0 here) + A("asr %15") // (bit7 is always 0 here) A("ror %14") L("11") - A("sbrs %3,2") // shift by 4 bit position ? - A("rjmp 12f") // No, skip it - A("swap %15") // Swap nibbles - A("andi %14, 0xF0") // Lose the lowest nibble - A("swap %14") // Swap nibbles. Upper nibble is 0 - A("or %14,%15") // Pass nibble from upper byte - A("andi %15, 0x0F") // And get rid of that nibble + A("sbrs %3,2") // shift by 4 bit position ? + A("rjmp 12f") // No, skip it + A("swap %15") // Swap nibbles + A("andi %14, 0xF0") // Lose the lowest nibble + A("swap %14") // Swap nibbles. Upper nibble is 0 + A("or %14,%15") // Pass nibble from upper byte + A("andi %15, 0x0F") // And get rid of that nibble L("12") - A("sbrs %3,3") // shift by 8 bit position ? - A("rjmp 6f") // No, skip it + A("sbrs %3,3") // shift by 8 bit position ? + A("rjmp 6f") // No, skip it A("mov %14,%15") A("clr %15") - L("6") // %16:%15:%14 = initial estimation of 0x1000000 / d + L("6") // %16:%15:%14 = initial estimation of 0x1000000 / d // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration // of Newton-Raphson. As it has a quadratic convergence, 1 iteration is enough @@ -513,33 +517,33 @@ void Planner::init() { A("clr %0") A("clr %1") A("clr %2") - A("ldi %3,2") // %3:%2:%1:%0 = 0x2000000 - A("mul %6,%14") // r1:r0 = LO(d) * LO(x) + A("ldi %3,2") // %3:%2:%1:%0 = 0x2000000 + A("mul %6,%14") // r1:r0 = LO(d) * LO(x) A("sub %0,r0") A("sbc %1,r1") A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%14") // r1:r0 = MI(d) * LO(x) + A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) + A("mul %7,%14") // r1:r0 = MI(d) * LO(x) A("sub %1,r0") A("sbc %2,r1" ) - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%14") // r1:r0 = HI(d) * LO(x) + A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 + A("mul %8,%14") // r1:r0 = HI(d) * LO(x) A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%15") // r1:r0 = LO(d) * MI(x) + A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 + A("mul %6,%15") // r1:r0 = LO(d) * MI(x) A("sub %1,r0") A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%15") // r1:r0 = MI(d) * MI(x) + A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 + A("mul %7,%15") // r1:r0 = MI(d) * MI(x) A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%15") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%16") // r1:r0 = LO(d) * HI(x) + A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 + A("mul %8,%15") // r1:r0 = HI(d) * MI(x) + A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 + A("mul %6,%16") // r1:r0 = LO(d) * HI(x) A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%16") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 + A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 + A("mul %7,%16") // r1:r0 = MI(d) * HI(x) + A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 // %3:%2:%1:%0 = (1<<25) - x*d [169] // We need to multiply that result by x, and we are only interested in the top 24bits of that multiply @@ -549,62 +553,62 @@ void Planner::init() { // %13 = 0 // result = %11:%10:%9:%5:%4 - A("mul %14,%0") // r1:r0 = LO(x) * LO(acc) + A("mul %14,%0") // r1:r0 = LO(x) * LO(acc) A("mov %4,r1") A("clr %5") A("clr %9") A("clr %10") - A("clr %11") // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8 - A("mul %15,%0") // r1:r0 = MI(x) * LO(acc) + A("clr %11") // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8 + A("mul %15,%0") // r1:r0 = MI(x) * LO(acc) A("add %4,r0") A("adc %5,r1") A("adc %9,%13") A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) - A("mul %16,%0") // r1:r0 = HI(x) * LO(acc) + A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) + A("mul %16,%0") // r1:r0 = HI(x) * LO(acc) A("add %5,r0") A("adc %9,r1") A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8 + A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8 - A("mul %14,%1") // r1:r0 = LO(x) * MIL(acc) + A("mul %14,%1") // r1:r0 = LO(x) * MIL(acc) A("add %4,r0") A("adc %5,r1") A("adc %9,%13") A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIL(acc) - A("mul %15,%1") // r1:r0 = MI(x) * MIL(acc) + A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIL(acc) + A("mul %15,%1") // r1:r0 = MI(x) * MIL(acc) A("add %5,r0") A("adc %9,r1") A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8 - A("mul %16,%1") // r1:r0 = HI(x) * MIL(acc) + A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8 + A("mul %16,%1") // r1:r0 = HI(x) * MIL(acc) A("add %9,r0") A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16 + A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16 - A("mul %14,%2") // r1:r0 = LO(x) * MIH(acc) + A("mul %14,%2") // r1:r0 = LO(x) * MIH(acc) A("add %5,r0") A("adc %9,r1") A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8 - A("mul %15,%2") // r1:r0 = MI(x) * MIH(acc) + A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8 + A("mul %15,%2") // r1:r0 = MI(x) * MIH(acc) A("add %9,r0") A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16 - A("mul %16,%2") // r1:r0 = HI(x) * MIH(acc) + A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16 + A("mul %16,%2") // r1:r0 = HI(x) * MIH(acc) A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24 + A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24 - A("mul %14,%3") // r1:r0 = LO(x) * HI(acc) + A("mul %14,%3") // r1:r0 = LO(x) * HI(acc) A("add %9,r0") A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16 - A("mul %15,%3") // r1:r0 = MI(x) * HI(acc) + A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16 + A("mul %15,%3") // r1:r0 = MI(x) * HI(acc) A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24 - A("mul %16,%3") // r1:r0 = HI(x) * HI(acc) - A("add %11,r0") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32 + A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24 + A("mul %16,%3") // r1:r0 = HI(x) * HI(acc) + A("add %11,r0") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32 // At this point, %11:%10:%9 contains the new estimation of x. @@ -615,47 +619,47 @@ void Planner::init() { A("ldi %3,1") A("clr %2") A("clr %1") - A("clr %0") // %3:%2:%1:%0 = 0x1000000 - A("mul %6,%9") // r1:r0 = LO(d) * LO(x) + A("clr %0") // %3:%2:%1:%0 = 0x1000000 + A("mul %6,%9") // r1:r0 = LO(d) * LO(x) A("sub %0,r0") A("sbc %1,r1") A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%9") // r1:r0 = MI(d) * LO(x) + A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) + A("mul %7,%9") // r1:r0 = MI(d) * LO(x) A("sub %1,r0") A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%9") // r1:r0 = HI(d) * LO(x) + A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 + A("mul %8,%9") // r1:r0 = HI(d) * LO(x) A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%10") // r1:r0 = LO(d) * MI(x) + A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 + A("mul %6,%10") // r1:r0 = LO(d) * MI(x) A("sub %1,r0") A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%10") // r1:r0 = MI(d) * MI(x) + A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 + A("mul %7,%10") // r1:r0 = MI(d) * MI(x) A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%10") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%11") // r1:r0 = LO(d) * HI(x) + A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 + A("mul %8,%10") // r1:r0 = HI(d) * MI(x) + A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 + A("mul %6,%11") // r1:r0 = LO(d) * HI(x) A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%11") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 + A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 + A("mul %7,%11") // r1:r0 = MI(d) * HI(x) + A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 // %3:%2:%1:%0 = r = (1<<24) - x*d // %8:%7:%6 = d = interval // Perform the final correction A("sub %0,%6") A("sbc %1,%7") - A("sbc %2,%8") // r -= d - A("brcs 14f") // if ( r >= d) + A("sbc %2,%8") // r -= d + A("brcs 14f") // if ( r >= d) // %11:%10:%9 = x A("ldi %3,1") A("add %9,%3") A("adc %10,%13") - A("adc %11,%13") // x++ + A("adc %11,%13") // x++ L("14") // Estimation is done. %11:%10:%9 = x @@ -690,7 +694,9 @@ void Planner::init() { // All other 32-bit MPUs can easily do inverse using hardware division, // so we don't need to reduce precision or to use assembly language at all. // This routine, for all other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d - static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) { return 0xFFFFFFFF / d; } + static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) { + return d ? 0xFFFFFFFF / d : 0xFFFFFFFF; + } #endif #endif @@ -699,6 +705,12 @@ void Planner::init() { /** * Calculate trapezoid parameters, multiplying the entry- and exit-speeds * by the provided factors. + ** + * ############ VERY IMPORTANT ############ + * NOTE that the PRECONDITION to call this function is that the block is + * NOT BUSY and it is marked as RECALCULATE. That WARRANTIES the Stepper ISR + * is not and will not use the block while we modify it, so it is safe to + * alter its values. */ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor) { @@ -740,9 +752,6 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e cruise_rate = block->nominal_rate; #endif - // block->accelerate_until = accelerate_steps; - // block->decelerate_after = accelerate_steps+plateau_steps; - #if ENABLED(S_CURVE_ACCELERATION) // Jerk controlled speed requires to express speed versus time, NOT steps uint32_t acceleration_time = ((float)(cruise_rate - initial_rate) / accel) * (STEPPER_TIMER_RATE), @@ -751,32 +760,20 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e // And to offload calculations from the ISR, we also calculate the inverse of those times here uint32_t acceleration_time_inverse = get_period_inverse(acceleration_time); uint32_t deceleration_time_inverse = get_period_inverse(deceleration_time); - #endif - // Fill variables used by the stepper in a critical section - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - // Don't update variables if block is busy; it is being interpreted by the planner. - // If this happens, there's a problem... The block speed is inconsistent. Some values - // have already been updated, but the Stepper ISR is already using the block. Fortunately, - // the values being used by the Stepper ISR weren't touched, so just stop here... - // TODO: There may be a way to update a running block, depending on the stepper ISR position. - if (!TEST(block->flag, BLOCK_BIT_BUSY)) { - block->accelerate_until = accelerate_steps; - block->decelerate_after = accelerate_steps + plateau_steps; - block->initial_rate = initial_rate; - #if ENABLED(S_CURVE_ACCELERATION) - block->acceleration_time = acceleration_time; - block->deceleration_time = deceleration_time; - block->acceleration_time_inverse = acceleration_time_inverse; - block->deceleration_time_inverse = deceleration_time_inverse; - block->cruise_rate = cruise_rate; - #endif - block->final_rate = final_rate; - } - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + // Store new block parameters + block->accelerate_until = accelerate_steps; + block->decelerate_after = accelerate_steps + plateau_steps; + block->initial_rate = initial_rate; + #if ENABLED(S_CURVE_ACCELERATION) + block->acceleration_time = acceleration_time; + block->deceleration_time = deceleration_time; + block->acceleration_time_inverse = acceleration_time_inverse; + block->deceleration_time_inverse = deceleration_time_inverse; + block->cruise_rate = cruise_rate; + #endif + block->final_rate = final_rate; } /* PLANNER SPEED DEFINITION @@ -827,7 +824,7 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e streaming operating conditions. Use for planning optimizations by avoiding recomputing parts of the planner buffer that don't change with the addition of a new block, as describe above. In addition, this block can never be less than block_buffer_tail and will always be pushed forward and maintain - this requirement when encountered by the plan_discard_current_block() routine during a cycle. + this requirement when encountered by the Planner::discard_current_block() routine during a cycle. NOTE: Since the planner only computes on what's in the planner buffer, some motions with lots of short line segments, like G2/3 arcs or complex curves, may seem to move slow. This is because there simply isn't @@ -864,15 +861,26 @@ void Planner::reverse_pass_kernel(block_t* const current, const block_t * const const float new_entry_speed_sqr = TEST(current->flag, BLOCK_BIT_NOMINAL_LENGTH) ? max_entry_speed_sqr - : MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next ? next->entry_speed_sqr : sq(MINIMUM_PLANNER_SPEED), current->millimeters)); + : MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next ? next->entry_speed_sqr : sq(float(MINIMUM_PLANNER_SPEED)), current->millimeters)); if (current->entry_speed_sqr != new_entry_speed_sqr) { // Need to recalculate the block speed - Mark it now, so the stepper // ISR does not consume the block before being recalculated SBI(current->flag, BLOCK_BIT_RECALCULATE); - // Set the new entry speed - current->entry_speed_sqr = new_entry_speed_sqr; + // But there is an inherent race condition here, as the block may have + // become BUSY just before being marked RECALCULATE, so check for that! + if (stepper.is_block_busy(current)) { + // Block became busy. Clear the RECALCULATE flag (no point in + // recalculating BUSY blocks). And don't set its speed, as it can't + // be updated at this time. + CBI(current->flag, BLOCK_BIT_RECALCULATE); + } + else { + // Block is not BUSY so this is ahead of the Stepper ISR: + // Just Set the new entry speed. + current->entry_speed_sqr = new_entry_speed_sqr; + } } } } @@ -898,12 +906,11 @@ void Planner::reverse_pass() { // Reverse Pass: Coarsely maximize all possible deceleration curves back-planning from the last // block in buffer. Cease planning when the last optimal planned or tail pointer is reached. // NOTE: Forward pass will later refine and correct the reverse pass to create an optimal plan. - block_t *current; const block_t *next = NULL; while (block_index != planned_block_index) { // Perform the reverse pass - current = &block_buffer[block_index]; + block_t *current = &block_buffer[block_index]; // Only consider non sync blocks if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { @@ -913,6 +920,18 @@ void Planner::reverse_pass() { // Advance to the next block_index = prev_block_index(block_index); + + // The ISR could advance the block_buffer_planned while we were doing the reverse pass. + // We must try to avoid using an already consumed block as the last one - So follow + // changes to the pointer and make sure to limit the loop to the currently busy block + while (planned_block_index != block_buffer_planned) { + + // If we reached the busy block or an already processed block, break the loop now + if (block_index == planned_block_index) return; + + // Advance the pointer, following the busy block + planned_block_index = next_block_index(planned_block_index); + } } } @@ -936,11 +955,24 @@ void Planner::forward_pass_kernel(const block_t* const previous, block_t* const // so the stepper ISR does not consume the block before being recalculated SBI(current->flag, BLOCK_BIT_RECALCULATE); - // Always <= max_entry_speed_sqr. Backward pass sets this. - current->entry_speed_sqr = new_entry_speed_sqr; // Always <= max_entry_speed_sqr. Backward pass sets this. + // But there is an inherent race condition here, as the block maybe + // became BUSY, just before it was marked as RECALCULATE, so check + // if that is the case! + if (stepper.is_block_busy(current)) { + // Block became busy. Clear the RECALCULATE flag (no point in + // recalculating BUSY blocks and don't set its speed, as it can't + // be updated at this time. + CBI(current->flag, BLOCK_BIT_RECALCULATE); + } + else { + // Block is not BUSY, we won the race against the Stepper ISR: - // Set optimal plan pointer. - block_buffer_planned = block_index; + // Always <= max_entry_speed_sqr. Backward pass sets this. + current->entry_speed_sqr = new_entry_speed_sqr; // Always <= max_entry_speed_sqr. Backward pass sets this. + + // Set optimal plan pointer. + block_buffer_planned = block_index; + } } } @@ -977,7 +1009,13 @@ void Planner::forward_pass() { // Skip SYNC blocks if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { - forward_pass_kernel(previous, current, block_index); + // If there's no previous block or the previous block is not + // BUSY (thus, modifiable) run the forward_pass_kernel. Otherwise, + // the previous block became BUSY, so assume the current block's + // entry speed can't be altered (since that would also require + // updating the exit speed of the previous block). + if (!previous || !stepper.is_block_busy(previous)) + forward_pass_kernel(previous, current, block_index); previous = current; } // Advance to the previous @@ -992,16 +1030,15 @@ void Planner::forward_pass() { */ void Planner::recalculate_trapezoids() { // The tail may be changed by the ISR so get a local copy. - uint8_t block_index = block_buffer_tail; - - // As there could be a sync block in the head of the queue, and the next loop must not - // recalculate the head block (as it needs to be specially handled), scan backwards until - // we find the first non SYNC block - uint8_t head_block_index = block_buffer_head; + uint8_t block_index = block_buffer_tail, + head_block_index = block_buffer_head; + // Since there could be a sync block in the head of the queue, and the + // next loop must not recalculate the head block (as it needs to be + // specially handled), scan backwards to the first non-SYNC block. while (head_block_index != block_index) { // Go back (head always point to the first free block) - uint8_t prev_index = prev_block_index(head_block_index); + const uint8_t prev_index = prev_block_index(head_block_index); // Get the pointer to the block block_t *prev = &block_buffer[prev_index]; @@ -1011,7 +1048,7 @@ void Planner::recalculate_trapezoids() { // Examine the previous block. This and all following are SYNC blocks head_block_index = prev_index; - }; + } // Go from the tail (currently executed block) to the first block, without including it) block_t *current = NULL, *next = NULL; @@ -1033,17 +1070,24 @@ void Planner::recalculate_trapezoids() { // RECALCULATE yet, but the next one is. That's the reason for the following line. SBI(current->flag, BLOCK_BIT_RECALCULATE); - // NOTE: Entry and exit factors always > 0 by all previous logic operations. - const float current_nominal_speed = SQRT(current->nominal_speed_sqr), - nomr = 1.0 / current_nominal_speed; - calculate_trapezoid_for_block(current, current_entry_speed * nomr, next_entry_speed * nomr); - #if ENABLED(LIN_ADVANCE) - if (current->use_advance_lead) { - const float comp = current->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; - current->max_adv_steps = current_nominal_speed * comp; - current->final_adv_steps = next_entry_speed * comp; - } - #endif + // But there is an inherent race condition here, as the block maybe + // became BUSY, just before it was marked as RECALCULATE, so check + // if that is the case! + if (!stepper.is_block_busy(current)) { + // Block is not BUSY, we won the race against the Stepper ISR: + + // NOTE: Entry and exit factors always > 0 by all previous logic operations. + const float current_nominal_speed = SQRT(current->nominal_speed_sqr), + nomr = 1.0f / current_nominal_speed; + calculate_trapezoid_for_block(current, current_entry_speed * nomr, next_entry_speed * nomr); + #if ENABLED(LIN_ADVANCE) + if (current->use_advance_lead) { + const float comp = current->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; + current->max_adv_steps = current_nominal_speed * comp; + current->final_adv_steps = next_entry_speed * comp; + } + #endif + } // Reset current only to ensure next trapezoid is computed - The // stepper is free to use the block from now on. @@ -1066,16 +1110,23 @@ void Planner::recalculate_trapezoids() { // marked as RECALCULATE yet. That's the reason for the following line. SBI(next->flag, BLOCK_BIT_RECALCULATE); - const float next_nominal_speed = SQRT(next->nominal_speed_sqr), - nomr = 1.0 / next_nominal_speed; - calculate_trapezoid_for_block(next, next_entry_speed * nomr, (MINIMUM_PLANNER_SPEED) * nomr); - #if ENABLED(LIN_ADVANCE) - if (next->use_advance_lead) { - const float comp = next->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; - next->max_adv_steps = next_nominal_speed * comp; - next->final_adv_steps = (MINIMUM_PLANNER_SPEED) * comp; - } - #endif + // But there is an inherent race condition here, as the block maybe + // became BUSY, just before it was marked as RECALCULATE, so check + // if that is the case! + if (!stepper.is_block_busy(current)) { + // Block is not BUSY, we won the race against the Stepper ISR: + + const float next_nominal_speed = SQRT(next->nominal_speed_sqr), + nomr = 1.0f / next_nominal_speed; + calculate_trapezoid_for_block(next, next_entry_speed * nomr, float(MINIMUM_PLANNER_SPEED) * nomr); + #if ENABLED(LIN_ADVANCE) + if (next->use_advance_lead) { + const float comp = next->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; + next->max_adv_steps = next_nominal_speed * comp; + next->final_adv_steps = (MINIMUM_PLANNER_SPEED) * comp; + } + #endif + } // Reset next only to ensure its trapezoid is computed - The stepper is free to use // the block from now on. @@ -1113,7 +1164,7 @@ void Planner::recalculate() { float t = autotemp_min + high * autotemp_factor; t = constrain(t, autotemp_min, autotemp_max); - if (t < oldt) t = t * (1 - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT); + if (t < oldt) t = t * (1 - float(AUTOTEMP_OLDWEIGHT)) + oldt * float(AUTOTEMP_OLDWEIGHT); oldt = t; thermalManager.setTargetHotend(t, 0); } @@ -1268,7 +1319,7 @@ void Planner::check_axes_activity() { * Return 1.0 with volumetric off or a diameter of 0.0. */ inline float calculate_volumetric_multiplier(const float &diameter) { - return (parser.volumetric_enabled && diameter) ? 1.0 / CIRCLE_AREA(diameter * 0.5) : 1.0; + return (parser.volumetric_enabled && diameter) ? 1.0f / CIRCLE_AREA(diameter * 0.5f) : 1; } /** @@ -1292,12 +1343,12 @@ void Planner::check_axes_activity() { */ void Planner::calculate_volumetric_for_width_sensor(const int8_t encoded_ratio) { // Reconstitute the nominal/measured ratio - const float nom_meas_ratio = 1.0 + 0.01 * encoded_ratio, + const float nom_meas_ratio = 1 + 0.01f * encoded_ratio, ratio_2 = sq(nom_meas_ratio); volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = parser.volumetric_enabled - ? ratio_2 / CIRCLE_AREA(filament_width_nominal * 0.5) // Volumetric uses a true volumetric multiplier - : ratio_2; // Linear squares the ratio, which scales the volume + ? ratio_2 / CIRCLE_AREA(filament_width_nominal * 0.5f) // Volumetric uses a true volumetric multiplier + : ratio_2; // Linear squares the ratio, which scales the volume refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM); } @@ -1419,7 +1470,7 @@ void Planner::quick_stop() { if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); // Drop all queue entries - block_buffer_planned = block_buffer_head = block_buffer_tail; + block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail; // Restart the block delay for the first movement - As the queue was // forced to empty, there's no risk the ISR will touch this. @@ -1518,9 +1569,9 @@ bool Planner::_buffer_steps(const int32_t (&target)[XYZE] // Fill the block with the specified movement if (!_populate_block(block, false, target - #if HAS_POSITION_FLOAT - , target_float - #endif + #if HAS_POSITION_FLOAT + , target_float + #endif , fr_mm_s, extruder, millimeters )) { // Movement was not queued, probably because it was too short. @@ -1641,7 +1692,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (de < 0) SBI(dm, E_AXIS); const float esteps_float = de * e_factor[extruder]; - const uint32_t esteps = ABS(esteps_float) + 0.5; + const uint32_t esteps = ABS(esteps_float) + 0.5f; // Clear all flags, including the "busy" bit block->flag = 0x00; @@ -1896,18 +1947,19 @@ bool Planner::_populate_block(block_t * const block, bool split_move, else block->millimeters = millimeters; - const float inverse_millimeters = 1.0 / block->millimeters; // Inverse millimeters to remove multiple divides + const float inverse_millimeters = 1.0f / block->millimeters; // Inverse millimeters to remove multiple divides // Calculate inverse time for this move. No divide by zero due to previous checks. // Example: At 120mm/s a 60mm move takes 0.5s. So this will give 2.0. float inverse_secs = fr_mm_s * inverse_millimeters; - const uint8_t moves_queued = movesplanned(); + // Get the number of non busy movements in queue (non busy means that they can be altered) + const uint8_t moves_queued = nonbusy_movesplanned(); // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill #if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT) // Segment time im micro seconds - uint32_t segment_time_us = LROUND(1000000.0 / inverse_secs); + uint32_t segment_time_us = LROUND(1000000.0f / inverse_secs); #endif #if ENABLED(SLOWDOWN) @@ -1915,7 +1967,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (segment_time_us < min_segment_time_us) { // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. const uint32_t nst = segment_time_us + LROUND(2 * (min_segment_time_us - segment_time_us) / moves_queued); - inverse_secs = 1000000.0 / nst; + inverse_secs = 1000000.0f / nst; #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD) segment_time_us = nst; #endif @@ -1955,7 +2007,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, while (filwidth_delay_dist >= MMD_MM) filwidth_delay_dist -= MMD_MM; // Convert into an index into the measurement array - filwidth_delay_index[0] = int8_t(filwidth_delay_dist * 0.1); + filwidth_delay_index[0] = int8_t(filwidth_delay_dist * 0.1f); // If the index has changed (must have gone forward)... if (filwidth_delay_index[0] != filwidth_delay_index[1]) { @@ -1971,7 +2023,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif // Calculate and limit speed in mm/sec for each axis - float current_speed[NUM_AXIS], speed_factor = 1.0; // factor <1 decreases speed + float current_speed[NUM_AXIS], speed_factor = 1.0f; // factor <1 decreases speed LOOP_XYZE(i) { const float cs = ABS((current_speed[i] = delta_mm[i] * inverse_secs)); #if ENABLED(DISTINCT_E_FACTORS) @@ -2019,7 +2071,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif // XY_FREQUENCY_LIMIT // Correct the speed - if (speed_factor < 1.0) { + if (speed_factor < 1.0f) { LOOP_XYZE(i) current_speed[i] *= speed_factor; block->nominal_rate *= speed_factor; block->nominal_speed_sqr = block->nominal_speed_sqr * sq(speed_factor); @@ -2056,7 +2108,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #if ENABLED(LIN_ADVANCE) #if ENABLED(JUNCTION_DEVIATION) - #define MAX_E_JERK (max_e_jerk_factor * max_acceleration_mm_per_s2[_EINDEX]) + #if ENABLED(DISTINCT_E_FACTORS) + #define MAX_E_JERK max_e_jerk[extruder] + #else + #define MAX_E_JERK max_e_jerk + #endif #else #define MAX_E_JERK max_jerk[E_AXIS] #endif @@ -2088,7 +2144,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Check for unusual high e_D ratio to detect if a retract move was combined with the last print move due to min. steps per segment. Never execute this with advance! // This assumes no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament. - if (block->e_D_ratio > 3.0) + if (block->e_D_ratio > 3.0f) block->use_advance_lead = false; else { const uint32_t max_accel_steps_per_s2 = MAX_E_JERK / (extruder_advance_K * block->e_D_ratio) * steps_per_mm; @@ -2123,7 +2179,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, block->acceleration_steps_per_s2 = accel; block->acceleration = accel / steps_per_mm; #if DISABLED(S_CURVE_ACCELERATION) - block->acceleration_rate = (uint32_t)(accel * (4096.0 * 4096.0 / (STEPPER_TIMER_RATE))); + block->acceleration_rate = (uint32_t)(accel * (4096.0f * 4096.0f / (STEPPER_TIMER_RATE))); #endif #if ENABLED(LIN_ADVANCE) if (block->use_advance_lead) { @@ -2176,21 +2232,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, already calculated in a different place. */ // Unit vector of previous path line segment - static float previous_unit_vec[ - #if ENABLED(JUNCTION_DEVIATION_INCLUDE_E) - XYZE - #else - XYZ - #endif - ]; + static float previous_unit_vec[XYZE]; float unit_vec[] = { delta_mm[A_AXIS] * inverse_millimeters, delta_mm[B_AXIS] * inverse_millimeters, - delta_mm[C_AXIS] * inverse_millimeters - #if ENABLED(JUNCTION_DEVIATION_INCLUDE_E) - , delta_mm[E_AXIS] * inverse_millimeters - #endif + delta_mm[C_AXIS] * inverse_millimeters, + delta_mm[E_AXIS] * inverse_millimeters }; // Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles. @@ -2200,38 +2248,34 @@ bool Planner::_populate_block(block_t * const block, bool split_move, float junction_cos_theta = -previous_unit_vec[X_AXIS] * unit_vec[X_AXIS] -previous_unit_vec[Y_AXIS] * unit_vec[Y_AXIS] -previous_unit_vec[Z_AXIS] * unit_vec[Z_AXIS] - #if ENABLED(JUNCTION_DEVIATION_INCLUDE_E) - -previous_unit_vec[E_AXIS] * unit_vec[E_AXIS] - #endif + -previous_unit_vec[E_AXIS] * unit_vec[E_AXIS] ; // NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta). - if (junction_cos_theta > 0.999999) { + if (junction_cos_theta > 0.999999f) { // For a 0 degree acute junction, just set minimum junction speed. - vmax_junction_sqr = sq(MINIMUM_PLANNER_SPEED); + vmax_junction_sqr = sq(float(MINIMUM_PLANNER_SPEED)); } else { - NOLESS(junction_cos_theta, -0.999999); // Check for numerical round-off to avoid divide by zero. + NOLESS(junction_cos_theta, -0.999999f); // Check for numerical round-off to avoid divide by zero. - float junction_unit_vec[JD_AXES] = { + // Convert delta vector to unit vector + float junction_unit_vec[XYZE] = { unit_vec[X_AXIS] - previous_unit_vec[X_AXIS], unit_vec[Y_AXIS] - previous_unit_vec[Y_AXIS], - unit_vec[Z_AXIS] - previous_unit_vec[Z_AXIS] - #if ENABLED(JUNCTION_DEVIATION_INCLUDE_E) - , unit_vec[E_AXIS] - previous_unit_vec[E_AXIS] - #endif + unit_vec[Z_AXIS] - previous_unit_vec[Z_AXIS], + unit_vec[E_AXIS] - previous_unit_vec[E_AXIS] }; - // Convert delta vector to unit vector normalize_junction_vector(junction_unit_vec); const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec), - sin_theta_d2 = SQRT(0.5 * (1.0 - junction_cos_theta)); // Trig half angle identity. Always positive. + sin_theta_d2 = SQRT(0.5f * (1.0f - junction_cos_theta)); // Trig half angle identity. Always positive. - vmax_junction_sqr = (junction_acceleration * junction_deviation_mm * sin_theta_d2) / (1.0 - sin_theta_d2); - if (block->millimeters < 1.0) { + vmax_junction_sqr = (junction_acceleration * junction_deviation_mm * sin_theta_d2) / (1.0f - sin_theta_d2); + if (block->millimeters < 1) { // Fast acos approximation, minus the error bar to be safe - const float junction_theta = (RADIANS(-40) * sq(junction_cos_theta) - RADIANS(50)) * junction_cos_theta + RADIANS(90) - 0.18; + const float junction_theta = (RADIANS(-40) * sq(junction_cos_theta) - RADIANS(50)) * junction_cos_theta + RADIANS(90) - 0.18f; // If angle is greater than 135 degrees (octagon), find speed for approximate arc if (junction_theta > RADIANS(135)) { @@ -2245,7 +2289,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, vmax_junction_sqr = MIN3(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr); } else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later. - vmax_junction_sqr = 0.0; + vmax_junction_sqr = 0; COPY(previous_unit_vec, unit_vec); @@ -2254,27 +2298,27 @@ bool Planner::_populate_block(block_t * const block, bool split_move, /** * Adapted from Průša MKS firmware * https://github.com/prusa3d/Prusa-Firmware - * - * Start with a safe speed (from which the machine may halt to stop immediately). */ + const float nominal_speed = SQRT(block->nominal_speed_sqr); // Exit speed limited by a jerk to full halt of a previous last segment static float previous_safe_speed; - const float nominal_speed = SQRT(block->nominal_speed_sqr); + // Start with a safe speed (from which the machine may halt to stop immediately). float safe_speed = nominal_speed; uint8_t limited = 0; LOOP_XYZE(i) { - const float jerk = ABS(current_speed[i]), maxj = max_jerk[i]; - if (jerk > maxj) { - if (limited) { - const float mjerk = maxj * nominal_speed; - if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; + const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis + maxj = max_jerk[i]; // mj : The max jerk setting for this axis + if (jerk > maxj) { // cs > mj : New current speed too fast? + if (limited) { // limited already? + const float mjerk = nominal_speed * maxj; // ns*mj + if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; // ns*mj/cs } else { - ++limited; - safe_speed = maxj; + safe_speed *= maxj / jerk; // Initial limit: ns*mj/cs + ++limited; // Initially limited } } } @@ -2336,11 +2380,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move, block->max_entry_speed_sqr = vmax_junction_sqr; // Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED. - const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(MINIMUM_PLANNER_SPEED), block->millimeters); + const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(float(MINIMUM_PLANNER_SPEED)), block->millimeters); // If we are trying to add a split block, start with the // max. allowed speed to avoid an interrupted first move. - block->entry_speed_sqr = !split_move ? sq(MINIMUM_PLANNER_SPEED) : MIN(vmax_junction_sqr, v_allowable_sqr); + block->entry_speed_sqr = !split_move ? sq(float(MINIMUM_PLANNER_SPEED)) : MIN(vmax_junction_sqr, v_allowable_sqr); // Initialize planner efficiency flags // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. @@ -2569,11 +2613,14 @@ void Planner::reset_acceleration_rates() { if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]); } cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL + #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) + recalculate_max_e_jerk(); + #endif } // Recalculate position, steps_to_mm if axis_steps_per_mm changes! void Planner::refresh_positioning() { - LOOP_XYZE_N(i) steps_to_mm[i] = 1.0 / axis_steps_per_mm[i]; + LOOP_XYZE_N(i) steps_to_mm[i] = 1.0f / axis_steps_per_mm[i]; set_position_mm_kinematic(current_position); reset_acceleration_rates(); } diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index d981c233e2..c362bf0f4b 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -54,9 +54,6 @@ enum BlockFlagBit : char { // from a safe speed (in consideration of jerking from zero speed). BLOCK_BIT_NOMINAL_LENGTH, - // The block is busy, being interpreted by the stepper ISR - BLOCK_BIT_BUSY, - // The block is segment 2+ of a longer move BLOCK_BIT_CONTINUED, @@ -67,7 +64,6 @@ enum BlockFlagBit : char { enum BlockFlag : char { BLOCK_FLAG_RECALCULATE = _BV(BLOCK_BIT_RECALCULATE), BLOCK_FLAG_NOMINAL_LENGTH = _BV(BLOCK_BIT_NOMINAL_LENGTH), - BLOCK_FLAG_BUSY = _BV(BLOCK_BIT_BUSY), BLOCK_FLAG_CONTINUED = _BV(BLOCK_BIT_CONTINUED), BLOCK_FLAG_SYNC_POSITION = _BV(BLOCK_BIT_SYNC_POSITION) }; @@ -83,7 +79,7 @@ enum BlockFlag : char { */ typedef struct { - uint8_t flag; // Block flags (See BlockFlag enum above) + volatile uint8_t flag; // Block flags (See BlockFlag enum above) - Modified by ISR and main thread! // Fields used by the motion planner to manage acceleration float nominal_speed_sqr, // The nominal speed for this block in (mm/sec)^2 @@ -153,7 +149,7 @@ typedef struct { } block_t; -#define HAS_POSITION_FLOAT (ENABLED(LIN_ADVANCE) || ENABLED(SCARA_FEEDRATE_SCALING)) +#define HAS_POSITION_FLOAT (ENABLED(LIN_ADVANCE) || HAS_FEEDRATE_SCALING) #define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) @@ -175,10 +171,12 @@ class Planner { */ static block_t block_buffer[BLOCK_BUFFER_SIZE]; static volatile uint8_t block_buffer_head, // Index of the next block to be pushed + block_buffer_nonbusy, // Index of the first non busy block + block_buffer_planned, // Index of the optimally planned block block_buffer_tail; // Index of the busy block, if any static uint16_t cleaning_buffer_counter; // A counter to disable queuing of blocks - static uint8_t delay_before_delivering, // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - block_buffer_planned; // Index of the optimally planned block + static uint8_t delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks + #if ENABLED(DISTINCT_E_FACTORS) static uint8_t last_extruder; // Respond to extruder change @@ -210,7 +208,11 @@ class Planner { #if ENABLED(JUNCTION_DEVIATION) static float junction_deviation_mm; // (mm) M205 J #if ENABLED(LIN_ADVANCE) - static float max_e_jerk_factor; // Calculated from junction_deviation_mm + #if ENABLED(DISTINCT_E_FACTORS) + static float max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm + #else + static float max_e_jerk; + #endif #endif #else static float max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. @@ -322,7 +324,7 @@ class Planner { static void refresh_positioning(); FORCE_INLINE static void refresh_e_factor(const uint8_t e) { - e_factor[e] = (flow_percentage[e] * 0.01 + e_factor[e] = (flow_percentage[e] * 0.01f #if DISABLED(NO_VOLUMETRICS) * volumetric_multiplier[e] #endif @@ -360,19 +362,19 @@ class Planner { * Returns 0.0 if Z is past the specified 'Fade Height'. */ inline static float fade_scaling_factor_for_z(const float &rz) { - static float z_fade_factor = 1.0; + static float z_fade_factor = 1; if (z_fade_height) { - if (rz >= z_fade_height) return 0.0; + if (rz >= z_fade_height) return 0; if (last_fade_z != rz) { last_fade_z = rz; - z_fade_factor = 1.0 - rz * inverse_z_fade_height; + z_fade_factor = 1 - rz * inverse_z_fade_height; } return z_fade_factor; } - return 1.0; + return 1; } - FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999; } + FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; } FORCE_INLINE static void set_z_fade_height(const float &zfh) { z_fade_height = zfh > 0 ? zfh : 0; @@ -388,7 +390,7 @@ class Planner { FORCE_INLINE static float fade_scaling_factor_for_z(const float &rz) { UNUSED(rz); - return 1.0; + return 1; } FORCE_INLINE static bool leveling_active_at_z(const float &rz) { UNUSED(rz); return true; } @@ -439,11 +441,14 @@ class Planner { #define ARG_Z const float &rz #endif - // Number of moves currently in the planner + // Number of moves currently in the planner including the busy block, if any FORCE_INLINE static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail); } + // Number of nonbusy moves currently in the planner + FORCE_INLINE static uint8_t nonbusy_movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_nonbusy); } + // Remove all blocks from the buffer - FORCE_INLINE static void clear_block_buffer() { block_buffer_head = block_buffer_tail = 0; } + FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail = 0; } // Check if movement queue is full FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } @@ -645,7 +650,7 @@ class Planner { static block_t* get_current_block() { // Get the number of moves in the planner queue so far - uint8_t nr_moves = movesplanned(); + const uint8_t nr_moves = movesplanned(); // If there are any moves queued ... if (nr_moves) { @@ -669,8 +674,14 @@ class Planner { block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it. #endif - // Mark the block as busy, so the planner does not attempt to replan it - SBI(block->flag, BLOCK_BIT_BUSY); + // As this block is busy, advance the nonbusy block pointer + block_buffer_nonbusy = next_block_index(block_buffer_tail); + + // Push block_buffer_planned pointer, if encountered. + if (block_buffer_tail == block_buffer_planned) + block_buffer_planned = block_buffer_nonbusy; + + // Return the block return block; } @@ -688,14 +699,8 @@ class Planner { * NB: There MUST be a current block to call this function!! */ FORCE_INLINE static void discard_current_block() { - if (has_blocks_queued()) { // Discard non-empty buffer. - uint8_t block_index = next_block_index( block_buffer_tail ); - - // Push block_buffer_planned pointer, if encountered. - if (!has_blocks_queued()) block_buffer_planned = block_index; - - block_buffer_tail = block_index; - } + if (has_blocks_queued()) + block_buffer_tail = next_block_index(block_buffer_tail); } #if ENABLED(ULTRA_LCD) @@ -750,9 +755,15 @@ class Planner { #endif #if ENABLED(JUNCTION_DEVIATION) - FORCE_INLINE static void recalculate_max_e_jerk_factor() { + FORCE_INLINE static void recalculate_max_e_jerk() { + #define GET_MAX_E_JERK(N) SQRT(SQRT(0.5) * junction_deviation_mm * (N) * RECIPROCAL(1.0 - SQRT(0.5))) #if ENABLED(LIN_ADVANCE) - max_e_jerk_factor = SQRT(SQRT(0.5) * junction_deviation_mm * RECIPROCAL(1.0 - SQRT(0.5))); + #if ENABLED(DISTINCT_E_FACTORS) + for (uint8_t i = 0; i < EXTRUDERS; i++) + max_e_jerk[i] = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS + i]); + #else + max_e_jerk = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS]); + #endif #endif } #endif @@ -819,22 +830,16 @@ class Planner { #if ENABLED(JUNCTION_DEVIATION) - #if ENABLED(JUNCTION_DEVIATION_INCLUDE_E) - #define JD_AXES XYZE - #else - #define JD_AXES XYZ - #endif - - FORCE_INLINE static void normalize_junction_vector(float (&vector)[JD_AXES]) { - float magnitude_sq = 0.0; - for (uint8_t idx = 0; idx < JD_AXES; idx++) if (vector[idx]) magnitude_sq += sq(vector[idx]); - const float inv_magnitude = 1.0 / SQRT(magnitude_sq); - for (uint8_t idx = 0; idx < JD_AXES; idx++) vector[idx] *= inv_magnitude; + FORCE_INLINE static void normalize_junction_vector(float (&vector)[XYZE]) { + float magnitude_sq = 0; + LOOP_XYZE(idx) if (vector[idx]) magnitude_sq += sq(vector[idx]); + const float inv_magnitude = RSQRT(magnitude_sq); + LOOP_XYZE(idx) vector[idx] *= inv_magnitude; } - FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[JD_AXES]) { + FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[XYZE]) { float limit_value = max_value; - for (uint8_t idx = 0; idx < JD_AXES; idx++) if (unit_vec[idx]) // Avoid divide by zero + LOOP_XYZE(idx) if (unit_vec[idx]) // Avoid divide by zero NOMORE(limit_value, ABS(max_acceleration_mm_per_s2[idx] / unit_vec[idx])); return limit_value; } diff --git a/Marlin/src/module/planner_bezier.cpp b/Marlin/src/module/planner_bezier.cpp index caf2528895..407d8a0670 100644 --- a/Marlin/src/module/planner_bezier.cpp +++ b/Marlin/src/module/planner_bezier.cpp @@ -40,12 +40,12 @@ #include "../gcode/queue.h" // See the meaning in the documentation of cubic_b_spline(). -#define MIN_STEP 0.002 -#define MAX_STEP 0.1 -#define SIGMA 0.1 +#define MIN_STEP 0.002f +#define MAX_STEP 0.1f +#define SIGMA 0.1f // Compute the linear interpolation between two real numbers. -inline static float interp(float a, float b, float t) { return (1.0 - t) * a + t * b; } +inline static float interp(float a, float b, float t) { return (1 - t) * a + t * b; } /** * Compute a Bézier curve using the De Casteljau's algorithm (see @@ -114,7 +114,7 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] first1 = position[Y_AXIS] + offset[1], second0 = target[X_AXIS] + offset[2], second1 = target[Y_AXIS] + offset[3]; - float t = 0.0; + float t = 0; float bez_target[4]; bez_target[X_AXIS] = position[X_AXIS]; @@ -123,7 +123,7 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] millis_t next_idle_ms = millis() + 200UL; - while (t < 1.0) { + while (t < 1) { thermalManager.manage_heater(); millis_t now = millis(); @@ -136,16 +136,16 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] // close to a linear interpolation. bool did_reduce = false; float new_t = t + step; - NOMORE(new_t, 1.0); + NOMORE(new_t, 1); float new_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], new_t), new_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], new_t); for (;;) { if (new_t - t < (MIN_STEP)) break; - const float candidate_t = 0.5 * (t + new_t), + const float candidate_t = 0.5f * (t + new_t), candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), - interp_pos0 = 0.5 * (bez_target[X_AXIS] + new_pos0), - interp_pos1 = 0.5 * (bez_target[Y_AXIS] + new_pos1); + interp_pos0 = 0.5f * (bez_target[X_AXIS] + new_pos0), + interp_pos1 = 0.5f * (bez_target[Y_AXIS] + new_pos1); if (dist1(candidate_pos0, candidate_pos1, interp_pos0, interp_pos1) <= (SIGMA)) break; new_t = candidate_t; new_pos0 = candidate_pos0; @@ -156,12 +156,12 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] // If we did not reduce the step, maybe we should enlarge it. if (!did_reduce) for (;;) { if (new_t - t > MAX_STEP) break; - const float candidate_t = t + 2.0 * (new_t - t); - if (candidate_t >= 1.0) break; + const float candidate_t = t + 2 * (new_t - t); + if (candidate_t >= 1) break; const float candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), - interp_pos0 = 0.5 * (bez_target[X_AXIS] + candidate_pos0), - interp_pos1 = 0.5 * (bez_target[Y_AXIS] + candidate_pos1); + interp_pos0 = 0.5f * (bez_target[X_AXIS] + candidate_pos0), + interp_pos1 = 0.5f * (bez_target[Y_AXIS] + candidate_pos1); if (dist1(new_pos0, new_pos1, interp_pos0, interp_pos1) > (SIGMA)) break; new_t = candidate_t; new_pos0 = candidate_pos0; diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index 66c6f2fbc4..44adcf45f2 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -53,7 +53,7 @@ millis_t PrintCounter::deltaDuration() { return lastDuration - tmp; } -void PrintCounter::incFilamentUsed(double const &amount) { +void PrintCounter::incFilamentUsed(float const &amount) { #if ENABLED(DEBUG_PRINTCOUNTER) debug(PSTR("incFilamentUsed")); #endif diff --git a/Marlin/src/module/printcounter.h b/Marlin/src/module/printcounter.h index db6f74606f..fa2f036314 100644 --- a/Marlin/src/module/printcounter.h +++ b/Marlin/src/module/printcounter.h @@ -37,13 +37,13 @@ #define STATS_EEPROM_ADDRESS 0x32 #endif -struct printStatistics { // 16 bytes (20 with real doubles) +struct printStatistics { // 16 bytes //const uint8_t magic; // Magic header, it will always be 0x16 uint16_t totalPrints; // Number of prints uint16_t finishedPrints; // Number of complete prints uint32_t printTime; // Accumulated printing time uint32_t longestPrint; // Longest successful print job - double filamentUsed; // Accumulated filament consumed in mm + float filamentUsed; // Accumulated filament consumed in mm }; class PrintCounter: public Stopwatch { @@ -128,7 +128,7 @@ class PrintCounter: public Stopwatch { * * @param amount The amount of filament used in mm */ - static void incFilamentUsed(double const &amount); + static void incFilamentUsed(float const &amount); /** * @brief Reset the Print Statistics diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index f3503cfad1..1b9cd39cda 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -532,7 +532,6 @@ static bool do_probe_move(const float z, const float fr_mm_s) { if (probe_triggered && set_bltouch_deployed(false)) return true; #endif - // Clear endstop flags endstops.hit_on_purpose(); // Get Z where the steppers were interrupted @@ -585,7 +584,7 @@ static float run_z_probe() { #endif // move up to make clearance for the probe - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); #else @@ -619,14 +618,14 @@ static float run_z_probe() { #if MULTIPLE_PROBING > 2 probes_total += current_position[Z_AXIS]; - if (p > 1) do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + if (p > 1) do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); } #endif #if MULTIPLE_PROBING > 2 // Return the average value of all probes - const float measured_z = probes_total * (1.0 / (MULTIPLE_PROBING)); + const float measured_z = probes_total * (1.0f / (MULTIPLE_PROBING)); #elif MULTIPLE_PROBING == 2 diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 3014a8966a..fe4c17b79e 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -71,7 +71,6 @@ FORCE_INLINE void bltouch_init() { // Make sure any BLTouch error condition is cleared bltouch_command(BLTOUCH_RESET); - set_bltouch_deployed(true); set_bltouch_deployed(false); } #endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 45f23b7a18..ba535cddf1 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -107,8 +107,6 @@ Stepper stepper; // Singleton // public: -block_t* Stepper::current_block = NULL; // A pointer to the block currently being traced - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) bool Stepper::homing_dual_axis = false; #endif @@ -119,6 +117,8 @@ block_t* Stepper::current_block = NULL; // A pointer to the block currently bei // private: +block_t* Stepper::current_block = NULL; // A pointer to the block currently being traced + uint8_t Stepper::last_direction_bits = 0, Stepper::axis_did_move; @@ -332,6 +332,11 @@ void Stepper::set_directions() { } #endif #endif // !LIN_ADVANCE + + // A small delay may be needed after changing direction + #if MINIMUM_STEPPER_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); + #endif } #if ENABLED(S_CURVE_ACCELERATION) @@ -1319,7 +1324,7 @@ void Stepper::stepper_pulse_phase_isr() { // Get the timer count and estimate the end of the pulse hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t(MIN_PULSE_TICKS); - const hal_timer_t added_step_ticks = ADDED_STEP_TICKS; + const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); // Take multiple steps per interrupt (For high speed moves) do { @@ -1660,6 +1665,7 @@ uint32_t Stepper::stepper_block_phase_isr() { acceleration_time = deceleration_time = 0; uint8_t oversampling = 0; // Assume we won't use it + #if ENABLED(ADAPTIVE_STEP_SMOOTHING) // At this point, we must decide if we can use Stepper movement axis smoothing. uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed) @@ -1814,7 +1820,7 @@ uint32_t Stepper::stepper_block_phase_isr() { // Get the timer count and estimate the end of the pulse hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t(MIN_PULSE_TICKS); - const hal_timer_t added_step_ticks = ADDED_STEP_TICKS; + const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); // Step E stepper if we have steps while (LA_steps) { @@ -1869,6 +1875,34 @@ uint32_t Stepper::stepper_block_phase_isr() { } #endif // LIN_ADVANCE +// Check if the given block is busy or not - Must not be called from ISR contexts +// The current_block could change in the middle of the read by an Stepper ISR, so +// we must explicitly prevent that! +bool Stepper::is_block_busy(const block_t* const block) { + #ifdef __AVR__ + // A SW memory barrier, to ensure GCC does not overoptimize loops + #define sw_barrier() asm volatile("": : :"memory"); + + // Keep reading until 2 consecutive reads return the same value, + // meaning there was no update in-between caused by an interrupt. + // This works because stepper ISRs happen at a slower rate than + // successive reads of a variable, so 2 consecutive reads with + // the same value means no interrupt updated it. + block_t* vold, *vnew = current_block; + sw_barrier(); + do { + vold = vnew; + vnew = current_block; + sw_barrier(); + } while (vold != vnew); + #else + block_t *vnew = current_block; + #endif + + // Return if the block is busy or not + return block == vnew; +} + void Stepper::init() { // Init Digipot Motor Current diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 21a76df266..2280bb78b8 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -58,7 +58,7 @@ #ifndef MAXIMUM_STEPPER_RATE #if MINIMUM_STEPPER_PULSE - #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (MINIMUM_STEPPER_PULSE))) + #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (unsigned long)(MINIMUM_STEPPER_PULSE))) #else #define MAXIMUM_STEPPER_RATE 500000UL #endif @@ -165,9 +165,9 @@ #define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES) // Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate -#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((F_CPU) / (MAXIMUM_STEPPER_RATE), ((F_CPU) / 500000UL) * (N)) +#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((unsigned long)((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N)) #if MINIMUM_STEPPER_PULSE - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES((MINIMUM_STEPPER_PULSE)) + #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES((unsigned long)(MINIMUM_STEPPER_PULSE)) #else #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1UL) #endif @@ -176,7 +176,7 @@ // adding the "start stepper pulse" code section execution cycles to account for that not all // pulses start at the beginning of the loop, so an extra time must be added to compensate so // the last generated pulse (usually the extruder stepper) has the right length -#define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * (MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / (PULSE_TIMER_PRESCALE))) +#define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * (unsigned long)(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / (unsigned long)(PULSE_TIMER_PRESCALE))) // Calculate the extra ticks of the PULSE timer between step pulses #define ADDED_STEP_TICKS (((MIN_STEPPER_PULSE_CYCLES) / (PULSE_TIMER_PRESCALE)) - (MIN_PULSE_TICKS)) @@ -234,8 +234,6 @@ class Stepper { public: - static block_t* current_block; // A pointer to the block currently being traced - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) static bool homing_dual_axis; #endif @@ -249,6 +247,8 @@ class Stepper { private: + static block_t* current_block; // A pointer to the block currently being traced + static uint8_t last_direction_bits, // The next stepping-bits to be output axis_did_move; // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner @@ -360,6 +360,9 @@ class Stepper { static uint32_t advance_isr(); #endif + // Check if the given block is busy or not - Must not be called from ISR contexts + static bool is_block_busy(const block_t* const block); + // Get the position of a stepper, in steps static int32_t position(const AxisEnum axis); diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index e1ac4a54ad..8858d22fdb 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -38,7 +38,7 @@ // // TMC26X Driver objects and inits // -#if ENABLED(HAVE_TMC26X) +#if HAS_DRIVER(TMC26X) #include #ifdef STM32F7 @@ -49,37 +49,37 @@ #define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR) - #if ENABLED(X_IS_TMC26X) + #if AXIS_DRIVER_TYPE(X, TMC26X) _TMC26X_DEFINE(X); #endif - #if ENABLED(X2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(X2, TMC26X) _TMC26X_DEFINE(X2); #endif - #if ENABLED(Y_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Y, TMC26X) _TMC26X_DEFINE(Y); #endif - #if ENABLED(Y2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Y2, TMC26X) _TMC26X_DEFINE(Y2); #endif - #if ENABLED(Z_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Z, TMC26X) _TMC26X_DEFINE(Z); #endif - #if ENABLED(Z2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Z2, TMC26X) _TMC26X_DEFINE(Z2); #endif - #if ENABLED(E0_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E0, TMC26X) _TMC26X_DEFINE(E0); #endif - #if ENABLED(E1_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E1, TMC26X) _TMC26X_DEFINE(E1); #endif - #if ENABLED(E2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E2, TMC26X) _TMC26X_DEFINE(E2); #endif - #if ENABLED(E3_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E3, TMC26X) _TMC26X_DEFINE(E3); #endif - #if ENABLED(E4_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E4, TMC26X) _TMC26X_DEFINE(E4); #endif @@ -89,46 +89,46 @@ }while(0) void tmc26x_init_to_defaults() { - #if ENABLED(X_IS_TMC26X) + #if AXIS_DRIVER_TYPE(X, TMC26X) _TMC26X_INIT(X); #endif - #if ENABLED(X2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(X2, TMC26X) _TMC26X_INIT(X2); #endif - #if ENABLED(Y_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Y, TMC26X) _TMC26X_INIT(Y); #endif - #if ENABLED(Y2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Y2, TMC26X) _TMC26X_INIT(Y2); #endif - #if ENABLED(Z_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Z, TMC26X) _TMC26X_INIT(Z); #endif - #if ENABLED(Z2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Z2, TMC26X) _TMC26X_INIT(Z2); #endif - #if ENABLED(E0_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E0, TMC26X) _TMC26X_INIT(E0); #endif - #if ENABLED(E1_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E1, TMC26X) _TMC26X_INIT(E1); #endif - #if ENABLED(E2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E2, TMC26X) _TMC26X_INIT(E2); #endif - #if ENABLED(E3_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E3, TMC26X) _TMC26X_INIT(E3); #endif - #if ENABLED(E4_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E4, TMC26X) _TMC26X_INIT(E4); #endif } -#endif // HAVE_TMC26X +#endif // TMC26X // // TMC2130 Driver objects and inits // -#if ENABLED(HAVE_TMC2130) +#if HAS_DRIVER(TMC2130) #include #include @@ -146,37 +146,37 @@ #endif // Stepper objects of TMC2130 steppers used - #if ENABLED(X_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X, TMC2130) _TMC2130_DEFINE(X); #endif - #if ENABLED(X2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X2, TMC2130) _TMC2130_DEFINE(X2); #endif - #if ENABLED(Y_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y, TMC2130) _TMC2130_DEFINE(Y); #endif - #if ENABLED(Y2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y2, TMC2130) _TMC2130_DEFINE(Y2); #endif - #if ENABLED(Z_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z, TMC2130) _TMC2130_DEFINE(Z); #endif - #if ENABLED(Z2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z2, TMC2130) _TMC2130_DEFINE(Z2); #endif - #if ENABLED(E0_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E0, TMC2130) _TMC2130_DEFINE(E0); #endif - #if ENABLED(E1_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E1, TMC2130) _TMC2130_DEFINE(E1); #endif - #if ENABLED(E2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E2, TMC2130) _TMC2130_DEFINE(E2); #endif - #if ENABLED(E3_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E3, TMC2130) _TMC2130_DEFINE(E3); #endif - #if ENABLED(E4_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E4, TMC2130) _TMC2130_DEFINE(E4); #endif @@ -213,74 +213,74 @@ #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) void tmc2130_init_to_defaults() { - #if ENABLED(X_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X, TMC2130) _TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]); #endif - #if ENABLED(X2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X2, TMC2130) _TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); #endif - #if ENABLED(Y_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y, TMC2130) _TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if ENABLED(Y2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y2, TMC2130) _TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if ENABLED(Z_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z, TMC2130) _TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if ENABLED(Z2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z2, TMC2130) _TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if ENABLED(E0_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E0, TMC2130) _TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); #endif - #if ENABLED(E1_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E1, TMC2130) { constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if ENABLED(E2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E2, TMC2130) { constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if ENABLED(E3_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E3, TMC2130) { constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if ENABLED(E4_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E4, TMC2130) { constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } #endif #if ENABLED(SENSORLESS_HOMING) #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY); - #ifdef X_HOMING_SENSITIVITY - #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) + #if X_SENSORLESS + #if AXIS_DRIVER_TYPE(X, TMC2130) stepperX.sgt(X_HOMING_SENSITIVITY); #endif - #if ENABLED(X2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X2, TMC2130) stepperX2.sgt(X_HOMING_SENSITIVITY); #endif #endif - #ifdef Y_HOMING_SENSITIVITY - #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) + #if Y_SENSORLESS + #if AXIS_DRIVER_TYPE(Y, TMC2130) stepperY.sgt(Y_HOMING_SENSITIVITY); #endif - #if ENABLED(Y2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y2, TMC2130) stepperY2.sgt(Y_HOMING_SENSITIVITY); #endif #endif - #ifdef Z_HOMING_SENSITIVITY - #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) + #if Z_SENSORLESS + #if AXIS_DRIVER_TYPE(Z, TMC2130) stepperZ.sgt(Z_HOMING_SENSITIVITY); #endif - #if ENABLED(Z2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z2, TMC2130) stepperZ2.sgt(Z_HOMING_SENSITIVITY); #endif #endif #endif } -#endif // HAVE_TMC2130 +#endif // TMC2130 // // TMC2208 Driver objects and inits // -#if ENABLED(HAVE_TMC2208) +#if HAS_DRIVER(TMC2208) #include #include @@ -296,77 +296,77 @@ TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL, ST##_SERIAL_RX_PIN > -1) // Stepper objects of TMC2208 steppers used - #if ENABLED(X_IS_TMC2208) + #if AXIS_DRIVER_TYPE(X, TMC2208) #ifdef X_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(X); #else _TMC2208_DEFINE_SOFTWARE(X); #endif #endif - #if ENABLED(X2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(X2, TMC2208) #ifdef X2_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(X2); #else _TMC2208_DEFINE_SOFTWARE(X2); #endif #endif - #if ENABLED(Y_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Y, TMC2208) #ifdef Y_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(Y); #else _TMC2208_DEFINE_SOFTWARE(Y); #endif #endif - #if ENABLED(Y2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Y2, TMC2208) #ifdef Y2_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(Y2); #else _TMC2208_DEFINE_SOFTWARE(Y2); #endif #endif - #if ENABLED(Z_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Z, TMC2208) #ifdef Z_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(Z); #else _TMC2208_DEFINE_SOFTWARE(Z); #endif #endif - #if ENABLED(Z2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Z2, TMC2208) #ifdef Z2_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(Z2); #else _TMC2208_DEFINE_SOFTWARE(Z2); #endif #endif - #if ENABLED(E0_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E0, TMC2208) #ifdef E0_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(E0); #else _TMC2208_DEFINE_SOFTWARE(E0); #endif #endif - #if ENABLED(E1_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E1, TMC2208) #ifdef E1_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(E1); #else _TMC2208_DEFINE_SOFTWARE(E1); #endif #endif - #if ENABLED(E2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E2, TMC2208) #ifdef E2_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(E2); #else _TMC2208_DEFINE_SOFTWARE(E2); #endif #endif - #if ENABLED(E3_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E3, TMC2208) #ifdef E3_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(E3); #else _TMC2208_DEFINE_SOFTWARE(E3); #endif #endif - #if ENABLED(E4_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E4, TMC2208) #ifdef E4_HARDWARE_SERIAL _TMC2208_DEFINE_HARDWARE(E4); #else @@ -375,37 +375,37 @@ #endif void tmc2208_serial_begin() { - #if ENABLED(X_IS_TMC2208) + #if AXIS_DRIVER_TYPE(X, TMC2208) X_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(X2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(X2, TMC2208) X2_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(Y_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Y, TMC2208) Y_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(Y2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Y2, TMC2208) Y2_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(Z_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Z, TMC2208) Z_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(Z2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Z2, TMC2208) Z2_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(E0_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E0, TMC2208) E0_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(E1_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E1, TMC2208) E1_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(E2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E2, TMC2208) E2_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(E3_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E3, TMC2208) E3_HARDWARE_SERIAL.begin(115200); #endif - #if ENABLED(E4_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E4, TMC2208) E4_HARDWARE_SERIAL.begin(115200); #endif } @@ -449,94 +449,94 @@ #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) void tmc2208_init_to_defaults() { - #if ENABLED(X_IS_TMC2208) + #if AXIS_DRIVER_TYPE(X, TMC2208) _TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]); #endif - #if ENABLED(X2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(X2, TMC2208) _TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); #endif - #if ENABLED(Y_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Y, TMC2208) _TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if ENABLED(Y2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Y2, TMC2208) _TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if ENABLED(Z_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Z, TMC2208) _TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if ENABLED(Z2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(Z2, TMC2208) _TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if ENABLED(E0_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E0, TMC2208) _TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); #endif - #if ENABLED(E1_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E1, TMC2208) { constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if ENABLED(E2_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E2, TMC2208) { constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if ENABLED(E3_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E3, TMC2208) { constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if ENABLED(E4_IS_TMC2208) + #if AXIS_DRIVER_TYPE(E4, TMC2208) { constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } #endif } -#endif // HAVE_TMC2208 +#endif // TMC2208 void restore_stepper_drivers() { - #if X_IS_TRINAMIC + #if AXIS_IS_TMC(X) stepperX.push(); #endif - #if X2_IS_TRINAMIC + #if AXIS_IS_TMC(X2) stepperX2.push(); #endif - #if Y_IS_TRINAMIC + #if AXIS_IS_TMC(Y) stepperY.push(); #endif - #if Y2_IS_TRINAMIC + #if AXIS_IS_TMC(Y2) stepperY2.push(); #endif - #if Z_IS_TRINAMIC + #if AXIS_IS_TMC(Z) stepperZ.push(); #endif - #if Z2_IS_TRINAMIC + #if AXIS_IS_TMC(Z2) stepperZ2.push(); #endif - #if E0_IS_TRINAMIC + #if AXIS_IS_TMC(E0) stepperE0.push(); #endif - #if E1_IS_TRINAMIC + #if AXIS_IS_TMC(E1) stepperE1.push(); #endif - #if E2_IS_TRINAMIC + #if AXIS_IS_TMC(E2) stepperE2.push(); #endif - #if E3_IS_TRINAMIC + #if AXIS_IS_TMC(E3) stepperE3.push(); #endif - #if E4_IS_TRINAMIC + #if AXIS_IS_TMC(E4) stepperE4.push(); #endif } void reset_stepper_drivers() { - #if ENABLED(HAVE_TMC26X) + #if HAS_DRIVER(TMC26X) tmc26x_init_to_defaults(); #endif - #if ENABLED(HAVE_TMC2130) + #if HAS_DRIVER(TMC2130) delay(100); tmc2130_init_to_defaults(); #endif - #if ENABLED(HAVE_TMC2208) + #if HAS_DRIVER(TMC2208) delay(100); tmc2208_init_to_defaults(); #endif #ifdef TMC_ADV TMC_ADV() #endif - #if ENABLED(HAVE_L6470DRIVER) + #if HAS_DRIVER(L6470) L6470_init_to_defaults(); #endif } @@ -544,7 +544,7 @@ void reset_stepper_drivers() { // // L6470 Driver objects and inits // -#if ENABLED(HAVE_L6470DRIVER) +#if HAS_DRIVER(L6470) #include #include @@ -552,37 +552,37 @@ void reset_stepper_drivers() { #define _L6470_DEFINE(ST) L6470 stepper##ST(ST##_ENABLE_PIN) // L6470 Stepper objects - #if ENABLED(X_IS_L6470) + #if AXIS_DRIVER_TYPE(X, L6470) _L6470_DEFINE(X); #endif - #if ENABLED(X2_IS_L6470) + #if AXIS_DRIVER_TYPE(X2, L6470) _L6470_DEFINE(X2); #endif - #if ENABLED(Y_IS_L6470) + #if AXIS_DRIVER_TYPE(Y, L6470) _L6470_DEFINE(Y); #endif - #if ENABLED(Y2_IS_L6470) + #if AXIS_DRIVER_TYPE(Y2, L6470) _L6470_DEFINE(Y2); #endif - #if ENABLED(Z_IS_L6470) + #if AXIS_DRIVER_TYPE(Z, L6470) _L6470_DEFINE(Z); #endif - #if ENABLED(Z2_IS_L6470) + #if AXIS_DRIVER_TYPE(Z2, L6470) _L6470_DEFINE(Z2); #endif - #if ENABLED(E0_IS_L6470) + #if AXIS_DRIVER_TYPE(E0, L6470) _L6470_DEFINE(E0); #endif - #if ENABLED(E1_IS_L6470) + #if AXIS_DRIVER_TYPE(E1, L6470) _L6470_DEFINE(E1); #endif - #if ENABLED(E2_IS_L6470) + #if AXIS_DRIVER_TYPE(E2, L6470) _L6470_DEFINE(E2); #endif - #if ENABLED(E3_IS_L6470) + #if AXIS_DRIVER_TYPE(E3, L6470) _L6470_DEFINE(E3); #endif - #if ENABLED(E4_IS_L6470) + #if AXIS_DRIVER_TYPE(E4, L6470) _L6470_DEFINE(E4); #endif @@ -595,39 +595,39 @@ void reset_stepper_drivers() { }while(0) void L6470_init_to_defaults() { - #if ENABLED(X_IS_L6470) + #if AXIS_DRIVER_TYPE(X, L6470) _L6470_INIT(X); #endif - #if ENABLED(X2_IS_L6470) + #if AXIS_DRIVER_TYPE(X2, L6470) _L6470_INIT(X2); #endif - #if ENABLED(Y_IS_L6470) + #if AXIS_DRIVER_TYPE(Y, L6470) _L6470_INIT(Y); #endif - #if ENABLED(Y2_IS_L6470) + #if AXIS_DRIVER_TYPE(Y2, L6470) _L6470_INIT(Y2); #endif - #if ENABLED(Z_IS_L6470) + #if AXIS_DRIVER_TYPE(Z, L6470) _L6470_INIT(Z); #endif - #if ENABLED(Z2_IS_L6470) + #if AXIS_DRIVER_TYPE(Z2, L6470) _L6470_INIT(Z2); #endif - #if ENABLED(E0_IS_L6470) + #if AXIS_DRIVER_TYPE(E0, L6470) _L6470_INIT(E0); #endif - #if ENABLED(E1_IS_L6470) + #if AXIS_DRIVER_TYPE(E1, L6470) _L6470_INIT(E1); #endif - #if ENABLED(E2_IS_L6470) + #if AXIS_DRIVER_TYPE(E2, L6470) _L6470_INIT(E2); #endif - #if ENABLED(E3_IS_L6470) + #if AXIS_DRIVER_TYPE(E3, L6470) _L6470_INIT(E3); #endif - #if ENABLED(E4_IS_L6470) + #if AXIS_DRIVER_TYPE(E4, L6470) _L6470_INIT(E4); #endif } -#endif // HAVE_L6470DRIVER +#endif // L6470 diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index 7b80a459bf..8ac4a0d8e9 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -47,7 +47,7 @@ #include "../inc/MarlinConfig.h" // TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI -#if ENABLED(HAVE_TMC26X) +#if HAS_DRIVER(TMC26X) #include #ifdef STM32F7 #include "../HAL/HAL_STM32F7/TMC2660.h" @@ -57,19 +57,19 @@ void tmc26x_init_to_defaults(); #endif -#if ENABLED(HAVE_TMC2130) +#if HAS_DRIVER(TMC2130) #include void tmc2130_init_to_defaults(); #endif -#if ENABLED(HAVE_TMC2208) +#if HAS_DRIVER(TMC2208) #include void tmc2208_serial_begin(); void tmc2208_init_to_defaults(); #endif // L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#if ENABLED(HAVE_L6470DRIVER) +#if HAS_DRIVER(L6470) #include #include void L6470_init_to_defaults(); @@ -79,7 +79,7 @@ void restore_stepper_drivers(); // Called by PSU_ON void reset_stepper_drivers(); // Called by settings.load / settings.reset // X Stepper -#if ENABLED(X_IS_L6470) +#if AXIS_DRIVER_TYPE(X, L6470) extern L6470 stepperX; #define X_ENABLE_INIT NOOP #define X_ENABLE_WRITE(STATE) do{ if (STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree(); }while(0) @@ -88,15 +88,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE) #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) #else - #if ENABLED(X_IS_TMC26X) + #if AXIS_DRIVER_TYPE(X, TMC26X) extern TMC26XStepper stepperX; #define X_ENABLE_INIT NOOP #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) #define X_ENABLE_READ stepperX.isEnabled() #else - #if ENABLED(X_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X, TMC2130) extern TMC2130Stepper stepperX; - #elif ENABLED(X_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(X, TMC2208) extern TMC2208Stepper stepperX; #endif #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) @@ -112,7 +112,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define X_STEP_READ READ(X_STEP_PIN) // Y Stepper -#if ENABLED(Y_IS_L6470) +#if AXIS_DRIVER_TYPE(Y, L6470) extern L6470 stepperY; #define Y_ENABLE_INIT NOOP #define Y_ENABLE_WRITE(STATE) do{ if (STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree(); }while(0) @@ -121,15 +121,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE) #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) #else - #if ENABLED(Y_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Y, TMC26X) extern TMC26XStepper stepperY; #define Y_ENABLE_INIT NOOP #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) #define Y_ENABLE_READ stepperY.isEnabled() #else - #if ENABLED(Y_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y, TMC2130) extern TMC2130Stepper stepperY; - #elif ENABLED(Y_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(Y, TMC2208) extern TMC2208Stepper stepperY; #endif #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) @@ -145,7 +145,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Y_STEP_READ READ(Y_STEP_PIN) // Z Stepper -#if ENABLED(Z_IS_L6470) +#if AXIS_DRIVER_TYPE(Z, L6470) extern L6470 stepperZ; #define Z_ENABLE_INIT NOOP #define Z_ENABLE_WRITE(STATE) do{ if (STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree(); }while(0) @@ -154,15 +154,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE) #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR) #else - #if ENABLED(Z_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Z, TMC26X) extern TMC26XStepper stepperZ; #define Z_ENABLE_INIT NOOP #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) #define Z_ENABLE_READ stepperZ.isEnabled() #else - #if ENABLED(Z_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z, TMC2130) extern TMC2130Stepper stepperZ; - #elif ENABLED(Z_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(Z, TMC2208) extern TMC2208Stepper stepperZ; #endif #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) @@ -179,7 +179,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // X2 Stepper #if HAS_X2_ENABLE - #if ENABLED(X2_IS_L6470) + #if AXIS_DRIVER_TYPE(X2, L6470) extern L6470 stepperX2; #define X2_ENABLE_INIT NOOP #define X2_ENABLE_WRITE(STATE) do{ if (STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree(); }while(0) @@ -188,15 +188,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE) #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) #else - #if ENABLED(X2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(X2, TMC26X) extern TMC26XStepper stepperX2; #define X2_ENABLE_INIT NOOP #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) #define X2_ENABLE_READ stepperX2.isEnabled() #else - #if ENABLED(X2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(X2, TMC2130) extern TMC2130Stepper stepperX2; - #elif ENABLED(X2_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(X2, TMC2208) extern TMC2208Stepper stepperX2; #endif #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) @@ -214,7 +214,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // Y2 Stepper #if HAS_Y2_ENABLE - #if ENABLED(Y2_IS_L6470) + #if AXIS_DRIVER_TYPE(Y2, L6470) extern L6470 stepperY2; #define Y2_ENABLE_INIT NOOP #define Y2_ENABLE_WRITE(STATE) do{ if (STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree(); }while(0) @@ -223,15 +223,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE) #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) #else - #if ENABLED(Y2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Y2, TMC26X) extern TMC26XStepper stepperY2; #define Y2_ENABLE_INIT NOOP #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) #define Y2_ENABLE_READ stepperY2.isEnabled() #else - #if ENABLED(Y2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Y2, TMC2130) extern TMC2130Stepper stepperY2; - #elif ENABLED(Y2_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(Y2, TMC2208) extern TMC2208Stepper stepperY2; #endif #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) @@ -249,7 +249,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // Z2 Stepper #if HAS_Z2_ENABLE - #if ENABLED(Z2_IS_L6470) + #if AXIS_DRIVER_TYPE(Z2, L6470) extern L6470 stepperZ2; #define Z2_ENABLE_INIT NOOP #define Z2_ENABLE_WRITE(STATE) do{ if (STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree(); }while(0) @@ -258,15 +258,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE) #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) #else - #if ENABLED(Z2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(Z2, TMC26X) extern TMC26XStepper stepperZ2; #define Z2_ENABLE_INIT NOOP #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) #define Z2_ENABLE_READ stepperZ2.isEnabled() #else - #if ENABLED(Z2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(Z2, TMC2130) extern TMC2130Stepper stepperZ2; - #elif ENABLED(Z2_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(Z2, TMC2208) extern TMC2208Stepper stepperZ2; #endif #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) @@ -283,7 +283,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif // E0 Stepper -#if ENABLED(E0_IS_L6470) +#if AXIS_DRIVER_TYPE(E0, L6470) extern L6470 stepperE0; #define E0_ENABLE_INIT NOOP #define E0_ENABLE_WRITE(STATE) do{ if (STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree(); }while(0) @@ -292,15 +292,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE) #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) #else - #if ENABLED(E0_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E0, TMC26X) extern TMC26XStepper stepperE0; #define E0_ENABLE_INIT NOOP #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) #define E0_ENABLE_READ stepperE0.isEnabled() #else - #if ENABLED(E0_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E0, TMC2130) extern TMC2130Stepper stepperE0; - #elif ENABLED(E0_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(E0, TMC2208) extern TMC2208Stepper stepperE0; #endif #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) @@ -316,7 +316,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E0_STEP_READ READ(E0_STEP_PIN) // E1 Stepper -#if ENABLED(E1_IS_L6470) +#if AXIS_DRIVER_TYPE(E1, L6470) extern L6470 stepperE1; #define E1_ENABLE_INIT NOOP #define E1_ENABLE_WRITE(STATE) do{ if (STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree(); }while(0) @@ -325,15 +325,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE) #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) #else - #if ENABLED(E1_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E1, TMC26X) extern TMC26XStepper stepperE1; #define E1_ENABLE_INIT NOOP #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) #define E1_ENABLE_READ stepperE1.isEnabled() #else - #if ENABLED(E1_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E1, TMC2130) extern TMC2130Stepper stepperE1; - #elif ENABLED(E1_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(E1, TMC2208) extern TMC2208Stepper stepperE1; #endif #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) @@ -349,7 +349,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E1_STEP_READ READ(E1_STEP_PIN) // E2 Stepper -#if ENABLED(E2_IS_L6470) +#if AXIS_DRIVER_TYPE(E2, L6470) extern L6470 stepperE2; #define E2_ENABLE_INIT NOOP #define E2_ENABLE_WRITE(STATE) do{ if (STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree(); }while(0) @@ -358,15 +358,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE) #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) #else - #if ENABLED(E2_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E2, TMC26X) extern TMC26XStepper stepperE2; #define E2_ENABLE_INIT NOOP #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) #define E2_ENABLE_READ stepperE2.isEnabled() #else - #if ENABLED(E2_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E2, TMC2130) extern TMC2130Stepper stepperE2; - #elif ENABLED(E2_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(E2, TMC2208) extern TMC2208Stepper stepperE2; #endif #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) @@ -382,7 +382,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E2_STEP_READ READ(E2_STEP_PIN) // E3 Stepper -#if ENABLED(E3_IS_L6470) +#if AXIS_DRIVER_TYPE(E3, L6470) extern L6470 stepperE3; #define E3_ENABLE_INIT NOOP #define E3_ENABLE_WRITE(STATE) do{ if (STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree(); }while(0) @@ -391,15 +391,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE) #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) #else - #if ENABLED(E3_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E3, TMC26X) extern TMC26XStepper stepperE3; #define E3_ENABLE_INIT NOOP #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) #define E3_ENABLE_READ stepperE3.isEnabled() #else - #if ENABLED(E3_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E3, TMC2130) extern TMC2130Stepper stepperE3; - #elif ENABLED(E3_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(E3, TMC2208) extern TMC2208Stepper stepperE3; #endif #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) @@ -415,7 +415,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E3_STEP_READ READ(E3_STEP_PIN) // E4 Stepper -#if ENABLED(E4_IS_L6470) +#if AXIS_DRIVER_TYPE(E4, L6470) extern L6470 stepperE4; #define E4_ENABLE_INIT NOOP #define E4_ENABLE_WRITE(STATE) do{ if (STATE) stepperE4.Step_Clock(stepperE4.getStatus() & STATUS_HIZ); else stepperE4.softFree(); }while(0) @@ -424,15 +424,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E4_DIR_WRITE(STATE) stepperE4.Step_Clock(STATE) #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR) #else - #if ENABLED(E4_IS_TMC26X) + #if AXIS_DRIVER_TYPE(E4, TMC26X) extern TMC26XStepper stepperE4; #define E4_ENABLE_INIT NOOP #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) #define E4_ENABLE_READ stepperE4.isEnabled() #else - #if ENABLED(E4_IS_TMC2130) + #if AXIS_DRIVER_TYPE(E4, TMC2130) extern TMC2130Stepper stepperE4; - #elif ENABLED(E4_IS_TMC2208) + #elif AXIS_DRIVER_TYPE(E4, TMC2208) extern TMC2208Stepper stepperE4; #endif #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 925032a9ec..c483fd0903 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -267,19 +267,29 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; workKp = 0, workKi = 0, workKd = 0, max = 0, min = 10000; - #define HAS_TP_BED (ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED)) - #if HAS_TP_BED && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) - #define TV(B,H) (hotend < 0 ? (B) : (H)) - #elif HAS_TP_BED - #define TV(B,H) (B) + #if HAS_PID_FOR_BOTH + #define GHV(B,H) (hotend < 0 ? (B) : (H)) + #define SHV(S,B,H) if (hotend < 0) S##_bed = B; else S [hotend] = H; + #elif ENABLED(PIDTEMPBED) + #define GHV(B,H) B + #define SHV(S,B,H) (S##_bed = B) #else - #define TV(B,H) (H) + #define GHV(B,H) H + #define SHV(S,B,H) (S [hotend] = H) #endif #if WATCH_THE_BED || WATCH_HOTENDS - const uint16_t watch_temp_period = TV(WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD); - const uint8_t watch_temp_increase = TV(WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE); - const float watch_temp_target = target - float(watch_temp_increase + TV(TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1); + #define HAS_TP_BED (ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED)) + #if HAS_TP_BED && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) + #define GTV(B,H) (hotend < 0 ? (B) : (H)) + #elif HAS_TP_BED + #define GTV(B,H) (B) + #else + #define GTV(B,H) (H) + #endif + const uint16_t watch_temp_period = GTV(WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD); + const uint8_t watch_temp_increase = GTV(WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE); + const float watch_temp_target = target - float(watch_temp_increase + GTV(TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1); millis_t temp_change_ms = next_temp_ms + watch_temp_period * 1000UL; float next_watch_temp = 0.0; bool heated = false; @@ -309,16 +319,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; disable_all_heaters(); // switch off all heaters. - #if HAS_PID_FOR_BOTH - if (hotend < 0) - soft_pwm_amount_bed = bias = d = (MAX_BED_POWER) >> 1; - else - soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1; - #elif ENABLED(PIDTEMP) - soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1; - #else - soft_pwm_amount_bed = bias = d = (MAX_BED_POWER) >> 1; - #endif + SHV(soft_pwm_amount, bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); wait_for_heatup = true; // Can be interrupted with M108 @@ -331,15 +332,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; updateTemperaturesFromRawValues(); // Get the current temperature and constrain it - current = - #if HAS_PID_FOR_BOTH - hotend < 0 ? current_temperature_bed : current_temperature[hotend] - #elif ENABLED(PIDTEMP) - current_temperature[hotend] - #else - current_temperature_bed - #endif - ; + current = GHV(current_temperature_bed, current_temperature[hotend]); NOLESS(max, current); NOMORE(min, current); @@ -353,16 +346,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; if (heating && current > target) { if (ELAPSED(ms, t2 + 5000UL)) { heating = false; - #if HAS_PID_FOR_BOTH - if (hotend < 0) - soft_pwm_amount_bed = (bias - d) >> 1; - else - soft_pwm_amount[hotend] = (bias - d) >> 1; - #elif ENABLED(PIDTEMP) - soft_pwm_amount[hotend] = (bias - d) >> 1; - #elif ENABLED(PIDTEMPBED) - soft_pwm_amount_bed = (bias - d) >> 1; - #endif + SHV(soft_pwm_amount, (bias - d) >> 1, (bias - d) >> 1); t1 = ms; t_high = t1 - t2; max = target; @@ -375,15 +359,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; t2 = ms; t_low = t2 - t1; if (cycles > 0) { - long max_pow = - #if HAS_PID_FOR_BOTH - hotend < 0 ? MAX_BED_POWER : PID_MAX - #elif ENABLED(PIDTEMP) - PID_MAX - #else - MAX_BED_POWER - #endif - ; + const long max_pow = GHV(MAX_BED_POWER, PID_MAX); bias += (d * (t_high - t_low)) / (t_low + t_high); bias = constrain(bias, 20, max_pow - 20); d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; @@ -393,13 +369,13 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); if (cycles > 2) { - Ku = (4.0 * d) / (M_PI * (max - min) * 0.5); - Tu = ((float)(t_low + t_high) * 0.001); + Ku = (4.0f * d) / (float(M_PI) * (max - min) * 0.5f); + Tu = ((float)(t_low + t_high) * 0.001f); SERIAL_PROTOCOLPAIR(MSG_KU, Ku); SERIAL_PROTOCOLPAIR(MSG_TU, Tu); - workKp = 0.6 * Ku; + workKp = 0.6f * Ku; workKi = 2 * workKp / Tu; - workKd = workKp * Tu * 0.125; + workKd = workKp * Tu * 0.125f; SERIAL_PROTOCOLLNPGM("\n" MSG_CLASSIC_PID); SERIAL_PROTOCOLPAIR(MSG_KP, workKp); SERIAL_PROTOCOLPAIR(MSG_KI, workKi); @@ -422,16 +398,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; */ } } - #if HAS_PID_FOR_BOTH - if (hotend < 0) - soft_pwm_amount_bed = (bias + d) >> 1; - else - soft_pwm_amount[hotend] = (bias + d) >> 1; - #elif ENABLED(PIDTEMP) - soft_pwm_amount[hotend] = (bias + d) >> 1; - #else - soft_pwm_amount_bed = (bias + d) >> 1; - #endif + SHV(soft_pwm_amount, (bias + d) >> 1, (bias + d) >> 1); cycles++; min = target; } @@ -460,10 +427,10 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; if ( #if WATCH_THE_BED && WATCH_HOTENDS true - #elif WATCH_THE_BED - hotend < 0 - #else + #elif WATCH_HOTENDS hotend >= 0 + #else + hotend < 0 #endif ) { if (!heated) { // If not yet reached target... @@ -494,7 +461,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED); #if HAS_PID_FOR_BOTH - const char* estring = hotend < 0 ? "bed" : ""; + const char* estring = GHV("bed", ""); SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp); SERIAL_EOL(); SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi); SERIAL_EOL(); SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd); SERIAL_EOL(); @@ -582,11 +549,13 @@ int Temperature::getHeaterPower(const int heater) { uint8_t fanDone = 0; for (uint8_t f = 0; f < COUNT(fanPin); f++) { - #ifdef ARDUINO - pin_t pin = pgm_read_byte(&fanPin[f]); - #else - pin_t pin = fanPin[f]; - #endif + const pin_t pin = + #ifdef ARDUINO + pgm_read_byte(&fanPin[f]) + #else + fanPin[f] + #endif + ; const uint8_t bit = pgm_read_byte(&fanBit[f]); if (pin >= 0 && !TEST(fanDone, bit)) { uint8_t newFanSpeed = TEST(fanState, bit) ? EXTRUDER_AUTO_FAN_SPEED : 0; @@ -644,7 +613,7 @@ float Temperature::get_pid_output(const int8_t e) { #if ENABLED(PIDTEMP) #if DISABLED(PID_OPENLOOP) pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX]; - dTerm[HOTEND_INDEX] = PID_K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + PID_K1 * dTerm[HOTEND_INDEX]; + dTerm[HOTEND_INDEX] = PID_K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + float(PID_K1) * dTerm[HOTEND_INDEX]; temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX]; #if HEATER_IDLE_HANDLER if (heater_idle_timeout_exceeded[HOTEND_INDEX]) { @@ -1098,7 +1067,7 @@ void Temperature::updateTemperaturesFromRawValues() { // Convert raw Filament Width to millimeters float Temperature::analog2widthFil() { - return current_raw_filwidth * 5.0 * (1.0 / 16383.0); + return current_raw_filwidth * 5.0f * (1.0f / 16383.0f); } /** @@ -1111,7 +1080,7 @@ void Temperature::updateTemperaturesFromRawValues() { */ int8_t Temperature::widthFil_to_size_ratio() { if (ABS(filament_width_nominal - filament_width_meas) <= FILWIDTH_ERROR_MARGIN) - return int(100.0 * filament_width_nominal / filament_width_meas) - 100; + return int(100.0f * filament_width_nominal / filament_width_meas) - 100; return 0; } @@ -1710,6 +1679,87 @@ void Temperature::set_current_temp_raw() { temp_meas_ready = true; } +void Temperature::readings_ready() { + // Update the raw values if they've been read. Else we could be updating them during reading. + if (!temp_meas_ready) set_current_temp_raw(); + + // Filament Sensor - can be read any time since IIR filtering is used + #if ENABLED(FILAMENT_WIDTH_SENSOR) + current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach + #endif + + ZERO(raw_temp_value); + + #if HAS_HEATED_BED + raw_temp_bed_value = 0; + #endif + + #if HAS_TEMP_CHAMBER + raw_temp_chamber_value = 0; + #endif + + #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1) + + int constexpr temp_dir[] = { + #if ENABLED(HEATER_0_USES_MAX6675) + 0 + #else + TEMPDIR(0) + #endif + #if HOTENDS > 1 + , TEMPDIR(1) + #if HOTENDS > 2 + , TEMPDIR(2) + #if HOTENDS > 3 + , TEMPDIR(3) + #if HOTENDS > 4 + , TEMPDIR(4) + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + }; + + for (uint8_t e = 0; e < COUNT(temp_dir); e++) { + const int16_t tdir = temp_dir[e], rawtemp = current_temperature_raw[e] * tdir; + const bool heater_on = 0 < + #if ENABLED(PIDTEMP) + soft_pwm_amount[e] + #else + target_temperature[e] + #endif + ; + if (rawtemp > maxttemp_raw[e] * tdir && heater_on) max_temp_error(e); + if (rawtemp < minttemp_raw[e] * tdir && !is_preheating(e) && heater_on) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error(e); + } + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + else + consecutive_low_temperature_error[e] = 0; + #endif + } + + #if HAS_HEATED_BED + #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP + #define GEBED <= + #else + #define GEBED >= + #endif + const bool bed_on = 0 < + #if ENABLED(PIDTEMPBED) + soft_pwm_amount_bed + #else + target_temperature_bed + #endif + ; + if (current_temperature_bed_raw GEBED bed_maxttemp_raw && bed_on) max_temp_error(-1); + if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1); + #endif +} + /** * Timer 0 is shared with millies so don't change the prescaler. * @@ -2027,6 +2077,12 @@ void Temperature::isr() { * * This gives each ADC 0.9765ms to charge up. */ + #define ACCUMULATE_ADC(var) do{ \ + if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ + else var += HAL_READ_ADC(); \ + }while(0) + + ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; switch (adc_sensor_state) { @@ -2036,21 +2092,30 @@ void Temperature::isr() { constexpr int8_t extra_loops = MIN_ADC_ISR_LOOPS - (int8_t)SensorsReady; static uint8_t delay_count = 0; if (extra_loops > 0) { - if (delay_count == 0) delay_count = extra_loops; // Init this delay - if (--delay_count) // While delaying... - adc_sensor_state = (ADCSensorState)(int(SensorsReady) - 1); // retain this state (else, next state will be 0) + if (delay_count == 0) delay_count = extra_loops; // Init this delay + if (--delay_count) // While delaying... + next_sensor_state = SensorsReady; // retain this state (else, next state will be 0) break; } - else - adc_sensor_state = (ADCSensorState)0; // Fall-through to start first sensor now + else { + adc_sensor_state = StartSampling; // Fall-through to start sampling + next_sensor_state = (ADCSensorState)(int(StartSampling) + 1); + } } + case StartSampling: // Start of sampling loops. Do updates/checks. + if (++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. + temp_count = 0; + readings_ready(); + } + break; + #if HAS_TEMP_ADC_0 case PrepareTemp_0: HAL_START_ADC(TEMP_0_PIN); break; case MeasureTemp_0: - raw_temp_value[0] += HAL_READ_ADC; + ACCUMULATE_ADC(raw_temp_value[0]); break; #endif @@ -2059,7 +2124,7 @@ void Temperature::isr() { HAL_START_ADC(TEMP_BED_PIN); break; case MeasureTemp_BED: - raw_temp_bed_value += HAL_READ_ADC; + ACCUMULATE_ADC(raw_temp_bed_value); break; #endif @@ -2068,7 +2133,7 @@ void Temperature::isr() { HAL_START_ADC(TEMP_CHAMBER_PIN); break; case MeasureTemp_CHAMBER: - raw_temp_chamber_value += HAL_READ_ADC; + ACCUMULATE_ADC(raw_temp_chamber_value); break; #endif @@ -2077,7 +2142,7 @@ void Temperature::isr() { HAL_START_ADC(TEMP_1_PIN); break; case MeasureTemp_1: - raw_temp_value[1] += HAL_READ_ADC; + ACCUMULATE_ADC(raw_temp_value[1]); break; #endif @@ -2086,7 +2151,7 @@ void Temperature::isr() { HAL_START_ADC(TEMP_2_PIN); break; case MeasureTemp_2: - raw_temp_value[2] += HAL_READ_ADC; + ACCUMULATE_ADC(raw_temp_value[2]); break; #endif @@ -2095,7 +2160,7 @@ void Temperature::isr() { HAL_START_ADC(TEMP_3_PIN); break; case MeasureTemp_3: - raw_temp_value[3] += HAL_READ_ADC; + ACCUMULATE_ADC(raw_temp_value[3]); break; #endif @@ -2104,7 +2169,7 @@ void Temperature::isr() { HAL_START_ADC(TEMP_4_PIN); break; case MeasureTemp_4: - raw_temp_value[4] += HAL_READ_ADC; + ACCUMULATE_ADC(raw_temp_value[4]); break; #endif @@ -2113,9 +2178,11 @@ void Temperature::isr() { HAL_START_ADC(FILWIDTH_PIN); break; case Measure_FILWIDTH: - if (HAL_READ_ADC > 102) { // Make sure ADC is reading > 0.5 volts, otherwise don't read. + if (!HAL_ADC_READY()) + next_sensor_state = adc_sensor_state; // redo this state + else if (HAL_READ_ADC() > 102) { // Make sure ADC is reading > 0.5 volts, otherwise don't read. raw_filwidth_value -= (raw_filwidth_value >> 7); // Subtract 1/128th of the raw_filwidth_value - raw_filwidth_value += ((unsigned long)HAL_READ_ADC << 7); // Add new ADC reading, scaled by 128 + raw_filwidth_value += ((unsigned long)HAL_READ_ADC() << 7); // Add new ADC reading, scaled by 128 } break; #endif @@ -2125,8 +2192,10 @@ void Temperature::isr() { HAL_START_ADC(ADC_KEYPAD_PIN); break; case Measure_ADC_KEY: - if (ADCKey_count < 16) { - raw_ADCKey_value = HAL_READ_ADC; + if (!HAL_ADC_READY()) + next_sensor_state = adc_sensor_state; // redo this state + else if (ADCKey_count < 16) { + raw_ADCKey_value = HAL_READ_ADC(); if (raw_ADCKey_value > 900) { //ADC Key release ADCKey_count = 0; @@ -2144,94 +2213,12 @@ void Temperature::isr() { } // switch(adc_sensor_state) - if (!adc_sensor_state && ++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - - temp_count = 0; - - // Update the raw values if they've been read. Else we could be updating them during reading. - if (!temp_meas_ready) set_current_temp_raw(); - - // Filament Sensor - can be read any time since IIR filtering is used - #if ENABLED(FILAMENT_WIDTH_SENSOR) - current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach - #endif - - ZERO(raw_temp_value); - - #if HAS_HEATED_BED - raw_temp_bed_value = 0; - #endif - - #if HAS_TEMP_CHAMBER - raw_temp_chamber_value = 0; - #endif - - #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1) - - int constexpr temp_dir[] = { - #if ENABLED(HEATER_0_USES_MAX6675) - 0 - #else - TEMPDIR(0) - #endif - #if HOTENDS > 1 - , TEMPDIR(1) - #if HOTENDS > 2 - , TEMPDIR(2) - #if HOTENDS > 3 - , TEMPDIR(3) - #if HOTENDS > 4 - , TEMPDIR(4) - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - }; - - for (uint8_t e = 0; e < COUNT(temp_dir); e++) { - const int16_t tdir = temp_dir[e], rawtemp = current_temperature_raw[e] * tdir; - const bool heater_on = 0 < - #if ENABLED(PIDTEMP) - soft_pwm_amount[e] - #else - target_temperature[e] - #endif - ; - if (rawtemp > maxttemp_raw[e] * tdir && heater_on) max_temp_error(e); - if (rawtemp < minttemp_raw[e] * tdir && !is_preheating(e) && heater_on) { - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) - #endif - min_temp_error(e); - } - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - else - consecutive_low_temperature_error[e] = 0; - #endif - } - - #if HAS_HEATED_BED - #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP - #define GEBED <= - #else - #define GEBED >= - #endif - const bool bed_on = 0 < - #if ENABLED(PIDTEMPBED) - soft_pwm_amount_bed - #else - target_temperature_bed - #endif - ; - if (current_temperature_bed_raw GEBED bed_maxttemp_raw && bed_on) max_temp_error(-1); - if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1); - #endif + // Go to the next state + adc_sensor_state = next_sensor_state; - } // temp_count >= OVERSAMPLENR - - // Go to the next state, up to SensorsReady - adc_sensor_state = (ADCSensorState)(int(adc_sensor_state) + 1); - if (adc_sensor_state > SensorsReady) adc_sensor_state = (ADCSensorState)0; + // + // Additional ~1KHz Tasks + // #if ENABLED(BABYSTEPPING) LOOP_XYZ(axis) { diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index bc9aa9a766..e8b80f97b5 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -52,6 +52,7 @@ * States for ADC reading in the ISR */ enum ADCSensorState : char { + StartSampling, #if HAS_TEMP_ADC_0 PrepareTemp_0, MeasureTemp_0, @@ -100,14 +101,14 @@ enum ADCSensorState : char { #define ACTUAL_ADC_SAMPLES MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady)) #if HAS_PID_HEATING - #define PID_K2 (1.0-PID_K1) + #define PID_K2 (1-float(PID_K1)) #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / TEMP_TIMER_FREQUENCY) // Apply the scale factors to the PID values - #define scalePID_i(i) ( (i) * PID_dT ) - #define unscalePID_i(i) ( (i) / PID_dT ) - #define scalePID_d(d) ( (d) / PID_dT ) - #define unscalePID_d(d) ( (d) * PID_dT ) + #define scalePID_i(i) ( float(i) * PID_dT ) + #define unscalePID_i(i) ( float(i) / PID_dT ) + #define scalePID_d(d) ( float(d) / PID_dT ) + #define unscalePID_d(d) ( float(d) * PID_dT ) #endif class Temperature { @@ -328,6 +329,7 @@ class Temperature { /** * Called from the Temperature ISR */ + static void readings_ready(); static void isr(); /** diff --git a/Marlin/src/module/thermistor/thermistor_501.h b/Marlin/src/module/thermistor/thermistor_501.h new file mode 100644 index 0000000000..512ac0d8d8 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_501.h @@ -0,0 +1,57 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +// 100k Zonestar thermistor. Adjusted By Hally +const short temptable_501[][2] PROGMEM = { + {OV( 1), 713}, + {OV( 14), 300}, // Top rating 300C + {OV( 16), 290}, + {OV( 19), 280}, + {OV( 23), 270}, + {OV( 27), 260}, + {OV( 32), 250}, + {OV( 30), 240}, + {OV( 47), 230}, + {OV( 57), 220}, + {OV( 68), 210}, + {OV( 84), 200}, + {OV( 100), 190}, + {OV( 128), 180}, + {OV( 155), 170}, + {OV( 189), 160}, + {OV( 230), 150}, + {OV( 278), 140}, + {OV( 336), 130}, + {OV( 402), 120}, + {OV( 476), 110}, + {OV( 554), 100}, + {OV( 635), 90}, + {OV( 713), 80}, + {OV( 784), 70}, + {OV( 846), 60}, + {OV( 897), 50}, + {OV( 937), 40}, + {OV( 966), 30}, + {OV( 986), 20}, + {OV(1000), 10}, + {OV(1010), 0} +}; diff --git a/Marlin/src/module/thermistor/thermistor_666.h b/Marlin/src/module/thermistor/thermistor_666.h new file mode 100755 index 0000000000..be76b03dfa --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_666.h @@ -0,0 +1,98 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * This file was generated by tltgen on Thu Jul 5 15:46:43 2018. + * tltgen was created by Pieter Agten (pieter.agten@gmail.com). + */ +//#include "output_table.h" + +/* + * Parameters: + * A: -0.000480634 + * B: 0.00031362 + * C: -2.03978e-07 + */ +#define NUMTEMPS 61 +const short temptable_666[NUMTEMPS][2] PROGMEM = { + { OV( 1), 794 }, + { OV( 18), 288 }, + { OV( 35), 234 }, + { OV( 52), 207 }, + { OV( 69), 189 }, + { OV( 86), 176 }, + { OV(103), 166 }, + { OV(120), 157 }, + { OV(137) ,150 }, + { OV(154), 144 }, + { OV(172), 138 }, + { OV(189), 134 }, + { OV(206), 129 }, + { OV(223), 125 }, + { OV(240), 121 }, + { OV(257), 118 }, + { OV(274), 115 }, + { OV(291), 112 }, + { OV(308), 109 }, + { OV(325), 106 }, + { OV(342), 103 }, + { OV(359), 101 }, + { OV(376), 99 }, + { OV(393), 96 }, + { OV(410), 94 }, + { OV(427), 92 }, + { OV(444), 90 }, + { OV(461), 88 }, + { OV(478), 86 }, + { OV(495), 84 }, + { OV(512), 82 }, + { OV(530), 80 }, + { OV(547), 78 }, + { OV(564), 76 }, + { OV(581), 74 }, + { OV(598), 72 }, + { OV(615), 70 }, + { OV(632), 68 }, + { OV(649), 67 }, + { OV(666), 65 }, + { OV(683), 63 }, + { OV(700), 61 }, + { OV(717), 59 }, + { OV(734), 57 }, + { OV(751), 55 }, + { OV(768), 53 }, + { OV(785), 51 }, + { OV(802), 49 }, + { OV(819), 47 }, + { OV(836), 44 }, + { OV(853), 42 }, + { OV(871), 39 }, + { OV(888), 37 }, + { OV(905), 34 }, + { OV(922), 30 }, + { OV(939), 27 }, + { OV(956), 23 }, + { OV(973), 18 }, + { OV(990), 11 }, + { OV(1007), 2 }, + { OV(1023),-25 } +}; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index d6f9e22025..56b75e1739 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -55,6 +55,9 @@ #if ANY_THERMISTOR_IS(5) // beta25 = 4267 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "ParCan, ATC 104GT-2" #include "thermistor_5.h" #endif +#if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor + #include "thermistor_501.h" +#endif #if ANY_THERMISTOR_IS(6) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 8.2 kOhm, "EPCOS ?" #include "thermistor_6.h" #endif @@ -97,7 +100,7 @@ #if ANY_THERMISTOR_IS(60) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Maker's Tool Works Kapton Bed" #include "thermistor_60.h" #endif -#if ANY_THERMISTOR_IS(66) // beta25 = 4500 K, R25 = 2.5 MOhm, Pull-up = 4.7 kOhm, "DyzeDesign 500 C Thermistor" +#if ANY_THERMISTOR_IS(66) // beta25 = 4500 K, R25 = 2.5 MOhm, Pull-up = 4.7 kOhm, "DyzeDesign 500 °C Thermistor" #include "thermistor_66.h" #endif #if ANY_THERMISTOR_IS(12) // beta25 = 4700 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Personal calibration for Makibox hot bed" @@ -115,6 +118,9 @@ #if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup #include "thermistor_147.h" #endif +#if ANY_THERMISTOR_IS(666) // beta25 = UNK, R25 = 200K, Pull-up = 10 kOhm, "Unidentified 200K NTC thermistor (Einstart S)" + #include "thermistor_666.h" +#endif #if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup #include "thermistor_1010.h" #endif @@ -200,8 +206,8 @@ #endif // The SCAN_THERMISTOR_TABLE macro needs alteration? -static_assert(HEATER_0_TEMPTABLE_LEN < 128 && HEATER_1_TEMPTABLE_LEN < 128 && HEATER_2_TEMPTABLE_LEN < 128 && HEATER_3_TEMPTABLE_LEN < 128 && HEATER_4_TEMPTABLE_LEN < 128 && BEDTEMPTABLE_LEN < 128 && CHAMBERTEMPTABLE_LEN < 128, - "Temperature conversion tables over 127 entries need special consideration." +static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256 && HEATER_4_TEMPTABLE_LEN < 256 && BEDTEMPTABLE_LEN < 256 && CHAMBERTEMPTABLE_LEN < 256, + "Temperature conversion tables over 255 entries need special consideration." ); // Set the high and low raw values for the heaters diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index d013c2c7a1..c7cdcb167a 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -352,6 +352,8 @@ inline void invalid_extruder_error(const uint8_t e) { * previous tool out of the way and the new tool into place. */ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { + planner.synchronize(); + #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 mixing_tool_change(tmp_extruder); @@ -375,9 +377,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif } - // Save current position to destination, for use later - set_destination_from_current(); - #if HAS_LEVELING // Set current position to the physical position const bool leveling_was_active = planner.leveling_active; @@ -386,10 +385,23 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #if ENABLED(DUAL_X_CARRIAGE) + #if HAS_SOFTWARE_ENDSTOPS + // Update the X software endstops early + active_extruder = tmp_extruder; + update_software_endstops(X_AXIS); + active_extruder = !tmp_extruder; + #endif + + // Don't move the new extruder out of bounds + if (!WITHIN(current_position[X_AXIS], soft_endstop_min[X_AXIS], soft_endstop_max[X_AXIS])) + no_move = true; + + if (!no_move) set_destination_from_current(); dualx_tool_change(tmp_extruder, no_move); // Can modify no_move #else // !DUAL_X_CARRIAGE + set_destination_from_current(); #if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder parking_extruder_tool_change(tmp_extruder, no_move); #endif @@ -422,16 +434,16 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif // !DUAL_X_CARRIAGE - #if HAS_LEVELING - // Restore leveling to re-establish the logical position - set_bed_leveling_enabled(leveling_was_active); - #endif - #if ENABLED(SWITCHING_NOZZLE) // The newly-selected extruder Z is actually at... current_position[Z_AXIS] -= zdiff; #endif + #if HAS_LEVELING + // Restore leveling to re-establish the logical position + set_bed_leveling_enabled(leveling_was_active); + #endif + // Tell the planner the new "current position" SYNC_PLAN_POSITION_KINEMATIC(); @@ -475,6 +487,10 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n feedrate_mm_s = old_feedrate_mm_s; + #if HAS_SOFTWARE_ENDSTOPS && ENABLED(DUAL_X_CARRIAGE) + update_software_endstops(X_AXIS); + #endif + #else // HOTENDS <= 1 UNUSED(fr_mm_s); diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 1feead8af2..5d10c5996b 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -110,6 +110,8 @@ #include "pins_MKS_GEN_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MKS_GEN_L) #include "pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 +#elif MB(KFB_2) + #include "pins_KFB_2.h" // ATmega2560 env:megaatmega2560 #elif MB(ZRIB_V20) #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (MKS_GEN_13) #elif MB(FELIX2) @@ -183,6 +185,8 @@ #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(GT2560_REV_A_PLUS) #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 +#elif MB(EINSTART_S) + #include "pins_EINSTART-S.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 // // ATmega1281, ATmega2561 @@ -250,21 +254,21 @@ // #elif MB(TEENSYLU) - #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90USB1286_CDC + #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90usb1286_cdc #elif MB(PRINTRBOARD) - #include "pins_PRINTRBOARD.h" // AT90USB1286 env:at90USB1286_DFU + #include "pins_PRINTRBOARD.h" // AT90USB1286 env:at90usb1286_dfu #elif MB(PRINTRBOARD_REVF) - #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90USB1286_DFU + #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90usb1286_dfu #elif MB(BRAINWAVE) - #include "pins_BRAINWAVE.h" // AT90USB646 env:at90USB1286_CDC + #include "pins_BRAINWAVE.h" // AT90USB646 env:at90usb1286_cdc #elif MB(BRAINWAVE_PRO) - #include "pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90USB1286_CDC + #include "pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90usb1286_cdc #elif MB(SAV_MKI) - #include "pins_SAV_MKI.h" // AT90USB1286 env:at90USB1286_CDC + #include "pins_SAV_MKI.h" // AT90USB1286 env:at90usb1286_cdc #elif MB(TEENSY2) #include "pins_TEENSY2.h" // AT90USB1286 env:teensy20 #elif MB(5DPRINT) - #include "pins_5DPRINT.h" // AT90USB1286 ?env:at90USB1286_DFU + #include "pins_5DPRINT.h" // AT90USB1286 env:at90usb1286_dfu // // LPC1768 ARM Cortex M3 @@ -305,8 +309,10 @@ #include "pins_DUE3DOM_MINI.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RADDS) #include "pins_RADDS.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RURAMPS4D) - #include "pins_RURAMPS4D.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug +#elif MB(RURAMPS4D_11) + #include "pins_RURAMPS4D_11.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug +#elif MB(RURAMPS4D_13) + #include "pins_RURAMPS4D_13.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_FD_V1) #include "pins_RAMPS_FD_V1.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_FD_V2) diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index e19858d528..4ea33dd5a6 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -917,9 +917,6 @@ #if PIN_EXISTS(Z_MS2) REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN) #endif -#if PIN_EXISTS(Z_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_PROBE_PIN) -#endif #if PIN_EXISTS(Z_STEP) REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN) #endif diff --git a/Marlin/src/pins/pins_BIQU_KFB_2.h b/Marlin/src/pins/pins_BIQU_KFB_2.h new file mode 100644 index 0000000000..f629424a8d --- /dev/null +++ b/Marlin/src/pins/pins_BIQU_KFB_2.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * KFB 2.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments + */ + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "KFB 2.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_NAME "KFB 2.0" + +// +// Heaters / Fans +// +// Power outputs BEEF or BEFF +#define MOSFET_D_PIN 7 + +#include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_EINSTART-S.h b/Marlin/src/pins/pins_EINSTART-S.h new file mode 100755 index 0000000000..94228553fe --- /dev/null +++ b/Marlin/src/pins/pins_EINSTART-S.h @@ -0,0 +1,122 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Einstart S pin assignments + * PCB Silkscreen: 3DPrinterCon_v3.5 + */ + +#if ENABLED(TARGET_LPC1768) + #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768." +#elif defined(__STM32F1__) + #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1." +#endif + +#if DISABLED(IS_RAMPS_SMART) && DISABLED(IS_RAMPS_DUO) && DISABLED(IS_RAMPS4DUE) && DISABLED(TARGET_LPC1768) + #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) + #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." + #endif +#endif + +#ifndef BOARD_NAME + #define BOARD_NAME "EINSTART_S" +#endif + +// +// Limit Switches +// +#define X_STOP_PIN 44 // 2560 PIN 40 +#define Y_STOP_PIN 43 // 2560 PIN 41 +#define Z_STOP_PIN 42 // 2560 PIN 42 + +// +// Steppers +// +#define X_STEP_PIN 76 // 2560 PIN 68 +#define X_DIR_PIN 75 // 2560 PIN 67 +#define X_ENABLE_PIN 73 // 2560 PIN 66 + +#define Y_STEP_PIN 31 // 2560 PIN 59 +#define Y_DIR_PIN 32 // 2560 PIN 58 +#define Y_ENABLE_PIN 72 // 2560 PIN 65 + +#define Z_STEP_PIN 34 // 2560 PIN 56 +#define Z_DIR_PIN 35 // 2560 PIN 55 +#define Z_ENABLE_PIN 33 // 2560 PIN 57 + +#define E0_STEP_PIN 36 // 2560 PIN 54 +#define E0_DIR_PIN 37 // 2560 PIN 53 +#define E0_ENABLE_PIN 30 // 2560 PIN 60 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 0 // Analog Input +#define TEMP_BED_PIN 1 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 83 // 2560 PIN 49 +#define HEATER_BED_PIN 38 // 2560 PIN 50 + +#define FAN_PIN 82 // 2560 PIN 48 + +// +// Misc. Functions +// +#define SDSS 53 // 2560 PIN 19 +#define LED_PIN 4 // 2560 PIN 1 + +////////////////////////// +// LCDs and Controllers // +////////////////////////// + +// +// LCD Display output pins +// + +// Requires #define U8GLIB_SH1106_EINSTART in Configuration.h +// u8glib constructor +// U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS); + +#define LCD_PINS_DC 78 // 2560 PIN 4 +#define LCD_PINS_RS 79 // 2560 PIN 8 +// DOGM SPI LCD Support +#define DOGLCD_CS 3 // 2560 PIN 7 +#define DOGLCD_MOSI 2 // 2560 PIN 6 +#define DOGLCD_SCK 5 // 2560 PIN 5 +#define DOGLCD_A0 2 // 2560 PIN 6 + +// +// LCD Display input pins +// +#define BTN_UP 25 // 2560 PIN 75 +#define BTN_DWN 26 // 2560 PIN 74 +#define BTN_LFT 27 // 2560 PIN 73 +#define BTN_RT 28 // 2560 PIN 72 + +// 'OK' button +#define BTN_ENC 29 // 2560 PIN 71 + +// Set Kill to right arrow, same as RIGID_PANEL +#define KILL_PIN 28 // 2560 PIN 72 diff --git a/Marlin/src/pins/pins_EINSY_RAMBO.h b/Marlin/src/pins/pins_EINSY_RAMBO.h index b3c1d1caa0..428dc047c8 100644 --- a/Marlin/src/pins/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/pins_EINSY_RAMBO.h @@ -33,10 +33,8 @@ // // TMC2130 Configuration_adv defaults for EinsyRambo // -#if DISABLED(HAVE_TMC2130) - #error "You must enable TMC2130 support in Configuration_adv.h for EinsyRambo." -#elif DISABLED(X_IS_TMC2130) || DISABLED(Y_IS_TMC2130) || DISABLED(Z_IS_TMC2130) || DISABLED(E0_IS_TMC2130) - #error "You must enable ([XYZ]|E0)_IS_TMC2130 in Configuration_adv.h for EinsyRambo." +#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130) + #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRambo." #endif // TMC2130 Diag Pins (currently just for reference) diff --git a/Marlin/src/pins/pins_EINSY_RETRO.h b/Marlin/src/pins/pins_EINSY_RETRO.h index df4f1c20be..a100d9329e 100644 --- a/Marlin/src/pins/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/pins_EINSY_RETRO.h @@ -33,10 +33,8 @@ // // TMC2130 Configuration_adv defaults for EinsyRetro // -#if DISABLED(HAVE_TMC2130) - #error "You must enable TMC2130 support in Configuration_adv.h for EinsyRetro." -#elif DISABLED(X_IS_TMC2130) || DISABLED(Y_IS_TMC2130) || DISABLED(Z_IS_TMC2130) || DISABLED(E0_IS_TMC2130) - #error "You must enable ([XYZ]|E0)_IS_TMC2130 in Configuration_adv.h for EinsyRetro." +#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130) + #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro." #endif // TMC2130 Diag Pins (currently just for reference) diff --git a/Marlin/src/pins/pins_FELIX2.h b/Marlin/src/pins/pins_FELIX2.h index 5d6765c840..83c4845745 100644 --- a/Marlin/src/pins/pins_FELIX2.h +++ b/Marlin/src/pins/pins_FELIX2.h @@ -34,7 +34,7 @@ // Heaters / Fans // // Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 +#define MOSFET_D_PIN 7 #include "pins_RAMPS.h" @@ -51,7 +51,7 @@ // #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - #define SD_DETECT_PIN 6 + #define SD_DETECT_PIN 6 #endif // NEWPANEL && ULTRA_LCD diff --git a/Marlin/src/pins/pins_MKS_BASE.h b/Marlin/src/pins/pins_MKS_BASE.h index 65c78e1486..90344c4084 100644 --- a/Marlin/src/pins/pins_MKS_BASE.h +++ b/Marlin/src/pins/pins_MKS_BASE.h @@ -36,7 +36,7 @@ // Heaters / Fans // // Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 +#define MOSFET_D_PIN 7 #define CASE_LIGHT_PIN 2 diff --git a/Marlin/src/pins/pins_MKS_GEN_13.h b/Marlin/src/pins/pins_MKS_GEN_13.h index e0e916b878..41e69d478a 100644 --- a/Marlin/src/pins/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/pins_MKS_GEN_13.h @@ -39,7 +39,7 @@ // Heaters / Fans // // Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 +#define MOSFET_D_PIN 7 // // PSU / SERVO @@ -47,8 +47,8 @@ // If POWER_SUPPLY is specified, always hijack Servo 3 // #if POWER_SUPPLY > 0 - #define SERVO3_PIN -1 - #define PS_ON_PIN 4 + #define SERVO3_PIN -1 + #define PS_ON_PIN 4 #endif #include "pins_RAMPS.h" @@ -100,45 +100,45 @@ // VIKI2 12-wire lead // - // orange/white SDCD - #define SD_DETECT_PIN 49 + // orange/white SDCD + #define SD_DETECT_PIN 49 - // white ENCA - #define BTN_EN1 35 + // white ENCA + #define BTN_EN1 35 - // green ENCB - #define BTN_EN2 37 + // green ENCB + #define BTN_EN2 37 - // purple ENCBTN - #define BTN_ENC 31 + // purple ENCBTN + #define BTN_ENC 31 - // brown A0 - #define DOGLCD_A0 27 + // brown A0 + #define DOGLCD_A0 27 - // green/white LCS - #define DOGLCD_CS 29 + // green/white LCS + #define DOGLCD_CS 29 - // 50 gray MISO - // 51 yellow MOSI - // 52 orange SCK + // 50 gray MISO + // 51 yellow MOSI + // 52 orange SCK - // blue SDCS - //#define SDSS 53 + // blue SDCS + //#define SDSS 53 // // VIKI2 4-wire lead // - // blue BTN - #define KILL_PIN 23 + // blue BTN + #define KILL_PIN 23 - // green BUZZER - #define BEEPER_PIN 25 + // green BUZZER + #define BEEPER_PIN 25 - // yellow RED-LED + // yellow RED-LED #define STAT_LED_RED_PIN 16 - // white BLUE-LED + // white BLUE-LED #define STAT_LED_BLUE_PIN 17 #endif diff --git a/Marlin/src/pins/pins_MKS_GEN_L.h b/Marlin/src/pins/pins_MKS_GEN_L.h index dd4568e152..59c5bcf481 100644 --- a/Marlin/src/pins/pins_MKS_GEN_L.h +++ b/Marlin/src/pins/pins_MKS_GEN_L.h @@ -36,4 +36,17 @@ // Power outputs EFBF or EFBE #define MOSFET_D_PIN 7 +// +// CS Pins wired to avoid conflict with the LCD +// See https://www.thingiverse.com/asset:66604 +// + +#ifndef X_CS_PIN + #define X_CS_PIN 59 +#endif + +#ifndef Y_CS_PIN + #define Y_CS_PIN 63 +#endif + #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_MKS_SBASE.h b/Marlin/src/pins/pins_MKS_SBASE.h index 7537d198f2..7a58198342 100644 --- a/Marlin/src/pins/pins_MKS_SBASE.h +++ b/Marlin/src/pins/pins_MKS_SBASE.h @@ -36,11 +36,13 @@ // unused /* -#define PIN_P0_27 P0_27 -#define PIN_P0_28 P0_28 +#define PIN_P0_27 P0_27 // EXP2/Onboard SD +#define PIN_P0_28 P0_28 // EXP2 +#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0) +#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) */ -#define LED_PIN P1_18 // LED2 P1_19, LED3 P1_20, LED4 P1_21 +#define LED_PIN P1_18 // LED2 P1_19, LED3 P1_20, LED4 P1_21 // // Servo pin @@ -51,7 +53,7 @@ #define SERVO3_PIN P4_28 // J8-6 // -// Limit Switches +// Limit Switches - Not Interrupt Capable // #define X_MIN_PIN P1_24 // 10k pullup to 3.3V, 1K series #define X_MAX_PIN P1_25 // 10k pullup to 3.3V, 1K series @@ -104,6 +106,8 @@ // // Connector J7 +// Note: These pins are all digitally shared with the EXP1/EXP2 Connector. +// Using them with an LCD connected or configured will lead to hangs & crashes. // // 5V @@ -111,8 +115,7 @@ // GND #define PIN_P0_17 P0_17 #define PIN_P0_16 P0_16 -#define PIN_P0_14 P0_14 - +#define PIN_P0_15 P0_15 // // Connector J8 @@ -120,24 +123,24 @@ // GND #define PIN_P1_22 P1_22 -#define PIN_P1_23 P1_23 -#define PIN_P2_12 P2_12 -#define PIN_P2_11 P2_11 +#define PIN_P1_23 P1_23 // PWM Capable +#define PIN_P2_12 P2_12 // Interrupt Capable +#define PIN_P2_11 P2_11 // Interrupt Capable #define PIN_P4_28 P4_28 // // Prusa i3 MK2 Multi Material Multiplexer Support // #if ENABLED(MK2_MULTIPLEXER) - #define E_MUX0_PIN P1_23 // J8-3 - #define E_MUX1_PIN P2_12 // J8-4 - #define E_MUX2_PIN P2_11 // J8-5 + #define E_MUX0_PIN P1_23 // J8-3 + #define E_MUX1_PIN P2_12 // J8-4 + #define E_MUX2_PIN P2_11 // J8-5 #endif // // Misc. Functions // -#define PS_ON_PIN P0_25 +#define PS_ON_PIN P0_25 //TH3 Connector #define LPC_SOFTWARE_SPI // MKS_SBASE needs a software SPI because the // selected pins are not on a hardware SPI controller @@ -163,7 +166,7 @@ #define LCD_SDSS P0_28 // EXP2.4 #define LCD_PINS_ENABLE P0_18 // EXP1.3 #define LCD_PINS_D4 P0_15 // EXP1.5 -#endif // ULTRA_LCD +#endif // // Ethernet pins @@ -173,6 +176,7 @@ #define ENET_RX_ER P1_14 // J12-6 #define ENET_RXD1 P1_10 // J12-8 #endif + #define ENET_MOC P1_16 // J12-3 #define REF_CLK P1_15 // J12-5 #define ENET_RXD0 P1_09 // J12-7 @@ -190,6 +194,49 @@ #define SS_PIN P0_28 #define SDSS P0_06 +/** + * Example for trinamic drivers using the J8 connector on MKs Sbase. + * 2130s need 1 pin for each driver. 2208s need 2 pins for serial control. + * This board does not have enough pins to use hardware serial. + */ + +#if HAS_DRIVER(TMC2130) + // J8 + #define X_CS_PIN P1_22 + #define Y_CS_PIN P1_23 + #define Z_CS_PIN P2_12 + #define E0_CS_PIN P2_11 + #define E1_CS_PIN P4_28 + +// Hardware SPI is on EXP2. See if you can make it work: +// https://github.com/makerbase-mks/MKS-SBASE/issues/25 +#define TMC_USE_SW_SPI +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI P0_03 // AUX1 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO P0_02 // AUX1 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK P0_26 // TH4 + #endif + #endif +#endif +#if HAS_DRIVER(TMC2208) + // The shortage of pins becomes apparent. + // Worst case you may have to give up the LCD + // RX pins need to be interrupt capable + #define X_SERIAL_TX_PIN P1_22 // J8-2 + #define X_SERIAL_RX_PIN P2_12 // J8-4 Interrupt Capable + #define Y_SERIAL_TX_PIN P1_23 // J8-3 + #define Y_SERIAL_RX_PIN P2_11 // J8-5 Interrupt Capable + #define Z_SERIAL_TX_PIN P2_12 // J8-4 + #define Z_SERIAL_RX_PIN P0_25 // TH3 + #define E0_SERIAL_TX_PIN P4_28 // J8-6 + #define E0_SERIAL_RX_PIN P0_26 // TH4 +#endif + /** * P0.27 is on EXP2 and the on-board SD card's socket. That means it can't be * used as the SD_DETECT for the LCD's SD card. @@ -202,7 +249,6 @@ */ #define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27) - /** * PWMs * @@ -226,9 +272,24 @@ /** * Special pins - * P1_30 - not 5V tolerant - * P1_31 - not 5V tolerant - * P0_27 - open collector - * P0_28 - open collector + * P1_30 - not 5V tolerant - EXP1 + * P1_31 - not 5V tolerant - EXP1 + * P0_27 - open collector - EXP2 + * P0_28 - open collector - EXP2 + * + */ + + /** + * Serial Ports + * P0_00 - Port 3 + * P0_01 - SD Card (Onboard) + * P0_10 - Port 2 + * P0_11 - Y_EN/Y_DIR + * P0_15 - Port 1 + * P0_16 - EXP1 + * P0_02 - Port 0 + * P0_03 - AUX1 + * P0_29 - Port -1 + * P0_30 - USB * */ diff --git a/Marlin/src/pins/pins_RADDS.h b/Marlin/src/pins/pins_RADDS.h index 68132604c7..872423d68d 100644 --- a/Marlin/src/pins/pins_RADDS.h +++ b/Marlin/src/pins/pins_RADDS.h @@ -100,29 +100,39 @@ #define E2_CS_PIN 35 #endif -// For Extension Board V2 +// +// Extension Board V2 // http://doku.radds.org/dokumentation/extension-board -//#define E3_STEP_PIN 35 -//#define E3_DIR_PIN 33 -//#define E3_ENABLE_PIN 37 -//#ifndef E3_CS_PIN -// #define E3_CS_PIN 6 -//#endif - -//#define Z2_STEP_PIN 29 -//#define Z2_DIR_PIN 27 -//#define Z2_ENABLE_PIN 31 -//#ifndef Z2_CS_PIN -// #define Z2_CS_PIN 39 -//#endif - -// Microstepping pins - Mapping not from fastio.h (?) -//#define E3_MS1_PIN 67 -//#define E3_MS2_PIN 68 -//#define E3_MS3_PIN 69 -//#define Z2_MS1_PIN 67 // shared with E3_MS1_PIN -//#define Z2_MS2_PIN 68 // shared with E3_MS2_PIN -//#define Z2_MS3_PIN 69 // shared with E3_MS3_PIN +// +//#define RADDS_EXTENSION +#if ENABLED(RADDS_EXTENSION) + #define E3_STEP_PIN 35 + #define E3_DIR_PIN 33 + #define E3_ENABLE_PIN 37 + #ifndef E3_CS_PIN + #define E3_CS_PIN 6 + #endif + + #define E3_MS1_PIN 67 + #define E3_MS2_PIN 68 + #define E3_MS3_PIN 69 + + #define Z2_STEP_PIN 29 + #define Z2_DIR_PIN 27 + #define Z2_ENABLE_PIN 31 + #ifndef Z2_CS_PIN + #define Z2_CS_PIN 39 + #endif + + #define Z2_MS1_PIN 67 // shared with E3_MS1_PIN + #define Z2_MS2_PIN 68 // shared with E3_MS2_PIN + #define Z2_MS3_PIN 69 // shared with E3_MS3_PIN + + #define RADDS_EXT_VDD1_PIN 25 + #define RADDS_EXT_VDD2_PIN 66 + + #define BOARD_INIT() OUT_WRITE(RADDS_EXT_VDD1_PIN, HIGH); OUT_WRITE(RADDS_EXT_VDD2_PIN, HIGH) +#endif // // Temperature Sensors diff --git a/Marlin/src/pins/pins_RAMPS.h b/Marlin/src/pins/pins_RAMPS.h index a85f3b6049..b8c6233da7 100644 --- a/Marlin/src/pins/pins_RAMPS.h +++ b/Marlin/src/pins/pins_RAMPS.h @@ -146,7 +146,7 @@ #endif #endif -#if ENABLED(HAVE_TMC2208) +#if HAS_DRIVER(TMC2208) /** * TMC2208 stepper drivers * diff --git a/Marlin/src/pins/pins_RAMPS_FD_V1.h b/Marlin/src/pins/pins_RAMPS_FD_V1.h index d8cdeb54f9..b6266fab83 100644 --- a/Marlin/src/pins/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/pins_RAMPS_FD_V1.h @@ -178,7 +178,7 @@ #endif // ULTRA_LCD -#if ENABLED(HAVE_TMC2208) +#if HAS_DRIVER(TMC2208) /** * TMC2208 stepper drivers * diff --git a/Marlin/src/pins/pins_RURAMPS4D.h b/Marlin/src/pins/pins_RURAMPS4D_11.h similarity index 89% rename from Marlin/src/pins/pins_RURAMPS4D.h rename to Marlin/src/pins/pins_RURAMPS4D_11.h index 4f4ad0977e..d05b74b04c 100644 --- a/Marlin/src/pins/pins_RURAMPS4D.h +++ b/Marlin/src/pins/pins_RURAMPS4D_11.h @@ -37,9 +37,15 @@ #endif #ifndef BOARD_NAME - #define BOARD_NAME "RuRAMPS4Due" + #define BOARD_NAME "RuRAMPS4Due v1.1" #endif +// +// Servos +// +#define SERVO0_PIN 5 +#define SERVO1_PIN 3 + // // Limit Switches // @@ -63,38 +69,51 @@ #define X_STEP_PIN 37 // Support Extension Board #define X_DIR_PIN 36 #define X_ENABLE_PIN 38 +#ifndef X_CS_PIN + #define X_CS_PIN -1 +#endif #define Y_STEP_PIN 32 // Support Extension Board #define Y_DIR_PIN 35 #define Y_ENABLE_PIN 34 +#ifndef Y_CS_PIN + #define Y_CS_PIN -1 +#endif #define Z_STEP_PIN 30 // Support Extension Board #define Z_DIR_PIN 2 #define Z_ENABLE_PIN 33 +#ifndef Z_CS_PIN + #define Z_CS_PIN -1 +#endif #define E0_STEP_PIN 29 #define E0_DIR_PIN 28 #define E0_ENABLE_PIN 31 +#ifndef E0_CS_PIN + #define E0_CS_PIN -1 +#endif #define E1_STEP_PIN 22 #define E1_DIR_PIN 24 #define E1_ENABLE_PIN 26 +#ifndef E1_CS_PIN + #define E1_CS_PIN -1 +#endif #define E2_STEP_PIN 25 #define E2_DIR_PIN 23 #define E2_ENABLE_PIN 27 +#ifndef E2_CS_PIN + #define E2_CS_PIN -1 +#endif #define E3_STEP_PIN 15 // Only For Extension Board #define E3_DIR_PIN 14 #define E3_ENABLE_PIN 61 - -//#define X_CS_PIN -1 -//#define Y_CS_PIN -1 -//#define Z_CS_PIN -1 -//#define E0_CS_PIN -1 -//#define E1_CS_PIN -1 -//#define E2_CS_PIN -1 -//#define E3_CS_PIN -1 +#ifndef E3_CS_PIN + #define E3_CS_PIN -1 +#endif // For Future: Microstepping pins - Mapping not from fastio.h (?) //#define E3_MS1_PIN ? @@ -136,8 +155,9 @@ #define TEMP_2_PIN 2 // ANALOG A2 #define TEMP_3_PIN 3 // ANALOG A2 #define TEMP_BED_PIN 4 // ANALOG A3 -//Thermocouple Use Analog Pins -#if ENABLED(VER_WITH_THERMOCOUPLE) // If Nead, define is in Configuration.h + +// The thermocouple uses Analog pins +#if ENABLED(VER_WITH_THERMOCOUPLE) // Defined in Configuration.h #define TEMP_4_PIN 5 // A5 #define TEMP_5_PIN 6 // A6 (Marlin 2.0 not support) #endif @@ -149,14 +169,6 @@ // #define MAX6675_SS 49 //#endif -// -// Servos -// -#define SERVO0_PIN 5 -#define SERVO1_PIN 3 -#define SERVO2_PIN -1 -#define SERVO3_PIN -1 - // // Misc. Functions // @@ -195,6 +207,8 @@ #if ENABLED(RADDS_DISPLAY) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #define BEEPER_PIN 62 + #define LCD_PINS_RS 63 #define LCD_PINS_ENABLE 64 #define LCD_PINS_D4 48 @@ -202,16 +216,12 @@ #define LCD_PINS_D6 52 #define LCD_PINS_D7 53 - #define BEEPER_PIN 62 - - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 - #define SD_DETECT_PIN 51 #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BEEPER_PIN 62 + #define LCD_PINS_RS 52 #define LCD_PINS_ENABLE 53 #define LCD_PINS_D4 48 @@ -219,20 +229,10 @@ #define LCD_PINS_D6 52 #define LCD_PINS_D7 53 - #define BEEPER_PIN 62 - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 - #define SD_DETECT_PIN 51 - #endif + #define SD_DETECT_PIN 51 #elif ENABLED(SSD1306_OLED_I2C_CONTROLLER) - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 #define BEEPER_PIN 62 #define LCD_SDSS 10 #define SD_DETECT_PIN 51 @@ -250,4 +250,10 @@ #endif // SPARK_FULL_GRAPHICS + #if ENABLED(NEWPANEL) + #define BTN_EN1 44 + #define BTN_EN2 42 + #define BTN_ENC 40 + #endif + #endif // ULTRA_LCD diff --git a/Marlin/src/pins/pins_RURAMPS4D_13.h b/Marlin/src/pins/pins_RURAMPS4D_13.h new file mode 100644 index 0000000000..ca80c21132 --- /dev/null +++ b/Marlin/src/pins/pins_RURAMPS4D_13.h @@ -0,0 +1,240 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Ported sys0724 & Vynt + */ + +/** + * Arduino Mega? or Due with RuRAMPS4DUE pin assignments + * + * Applies to the following boards: + * RURAMPS4DUE (Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) + * + * Differences between + * RADDS | RuRAMPS4DUE + * | + */ + +#ifndef __SAM3X8E__ + #error "Oops! Make sure you have 'Arduino Due' selected from the 'Tools -> Boards' menu." +#endif + +#ifndef BOARD_NAME + #define BOARD_NAME "RuRAMPS4Due v1.3" +#endif + +// +// Servos +// +#define SERVO0_PIN 5 +#define SERVO1_PIN 3 + +// +// Limit Switches +// +#define X_MIN_PIN 45 +#define X_MAX_PIN 39 +#define Y_MIN_PIN 46 +#define Y_MAX_PIN 41 +#define Z_MIN_PIN 47 +#define Z_MAX_PIN 43 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 49 +#endif + +// +// Steppers +// +#define X_STEP_PIN 37 // Support Extension Board +#define X_DIR_PIN 36 +#define X_ENABLE_PIN 31 +#ifndef X_CS_PIN + #define X_CS_PIN 38 +#endif + +#define Y_STEP_PIN 32 // Support Extension Board +#define Y_DIR_PIN 35 +#define Y_ENABLE_PIN 31 +#ifndef Y_CS_PIN + #define Y_CS_PIN 34 +#endif + +#define Z_STEP_PIN 30 // Support Extension Board +#define Z_DIR_PIN 2 +#define Z_ENABLE_PIN 31 +#ifndef Z_CS_PIN + #define Z_CS_PIN 10 +#endif + +#define E0_STEP_PIN 29 +#define E0_DIR_PIN 28 +#define E0_ENABLE_PIN 33 +#ifndef E0_CS_PIN + #define E0_CS_PIN 14 +#endif + +#define E1_STEP_PIN 22 +#define E1_DIR_PIN 24 +#define E1_ENABLE_PIN 26 +#ifndef E1_CS_PIN + #define E1_CS_PIN 15 +#endif + +#define E2_STEP_PIN 25 +#define E2_DIR_PIN 23 +#define E2_ENABLE_PIN 27 +#ifndef E2_CS_PIN + #define E2_CS_PIN 61 +#endif + +#if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #define Z_MIN_PROBE_PIN 49 +#endif + +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN Y_MIN_PIN + #endif +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN 13 +#define HEATER_1_PIN 12 +#define HEATER_2_PIN 11 +#define HEATER_BED_PIN 7 // BED H1 + +#define FAN_PIN 9 +#define FAN1_PIN 8 +#define CONTROLLER_FAN_PIN -1 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 0 // ANALOG A0 +#define TEMP_1_PIN 1 // ANALOG A1 +#define TEMP_2_PIN 2 // ANALOG A2 +#define TEMP_3_PIN 3 // ANALOG A2 +#define TEMP_BED_PIN 4 // ANALOG A3 + +// The thermocouple uses Analog pins +#if ENABLED(VER_WITH_THERMOCOUPLE) // Defined in Configuration.h + #define TEMP_4_PIN 5 // A5 + #define TEMP_5_PIN 6 // A6 (Marlin 2.0 not support) +#endif + +// SPI for Max6675 or Max31855 Thermocouple +//#if DISABLED(SDSUPPORT) +// #define MAX6675_SS 53 +//#else +// #define MAX6675_SS 49 +//#endif + +// +// Misc. Functions +// +#define SDSS 4 // 4,10,52 if using HW SPI. +#define LED_PIN -1 // 13 - HEATER_0_PIN +#define PS_ON_PIN -1 // 65 + +// MKS TFT / Nextion Use internal USART-1 +#define TFT_LCD_MODULE_COM 1 +#define TFT_LCD_MODULE_BAUDRATE 115600 + +// ESP WiFi Use internal USART-2 +#define ESP_WIFI_MODULE_COM 2 +#define ESP_WIFI_MODULE_BAUDRATE 115600 +#define ESP_WIFI_MODULE_RESET_PIN -1 +#define PIGGY_GPIO_PIN -1 + +// +// EEPROM +// +#define E2END 0x8000 // 32Kb (24lc256) +#define I2C_EEPROM // EEPROM on I2C-0 +//#define EEPROM_SD // EEPROM on SDCARD +//#define SPI_EEPROM // EEPROM on SPI-0 +//#define SPI_CHAN_EEPROM1 ? +//#define SPI_EEPROM1_CS ? +// 2K EEPROM +//#define SPI_EEPROM2_CS ? +// 32Mb FLASH +//#define SPI_FLASH_CS ? + +// +// LCD / Controller +// +#if ENABLED(ULTRA_LCD) + + #if ENABLED(RADDS_DISPLAY) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + + #define BEEPER_PIN 62 + + #define LCD_PINS_RS 63 + #define LCD_PINS_ENABLE 64 + #define LCD_PINS_D4 48 + #define LCD_PINS_D5 50 + #define LCD_PINS_D6 52 + #define LCD_PINS_D7 53 + + #define SD_DETECT_PIN 51 + + #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + + #define BEEPER_PIN 62 + + #define LCD_PINS_RS 52 + #define LCD_PINS_ENABLE 53 + #define LCD_PINS_D4 48 + #define LCD_PINS_D5 50 + #define LCD_PINS_D6 52 + #define LCD_PINS_D7 53 + + #define SD_DETECT_PIN 51 + + #elif ENABLED(SSD1306_OLED_I2C_CONTROLLER) + + #define BEEPER_PIN 62 + #define LCD_SDSS 10 + #define SD_DETECT_PIN 51 + + #elif ENABLED(MKS_MINI_12864) + + #define ORIG_BEEPER_PIN 62 + + #define DOGLCD_A0 52 + #define DOGLCD_CS 50 + + #define SD_DETECT_PIN 51 + + #endif + + #if ENABLED(NEWPANEL) + #define BTN_EN1 44 + #define BTN_EN2 42 + #define BTN_ENC 40 + #endif + +#endif // ULTRA_LCD diff --git a/Marlin/src/pins/pins_TRIGORILLA_14.h b/Marlin/src/pins/pins_TRIGORILLA_14.h index f1deb8fb07..70b0a930a9 100644 --- a/Marlin/src/pins/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/pins_TRIGORILLA_14.h @@ -33,9 +33,4 @@ #define FAN2_PIN 44 #define ORIG_E0_AUTO_FAN_PIN 44 -#include "pins_RAMPS_13.h" - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN -#undef E1_CS_PIN +#include "pins_RAMPS.h" diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 159086c82e..9ba018a2cf 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -43,8 +43,6 @@ #include -#define LONGEST_FILENAME (longFilename[0] ? longFilename : filename) - CardReader::CardReader() { #if ENABLED(SDCARD_SORT_ALPHA) sort_count = 0; @@ -541,9 +539,13 @@ void CardReader::checkautostart() { if (!cardOK) initsd(); - if (cardOK) { + if (cardOK + #if ENABLED(POWER_LOSS_RECOVERY) + && !jobRecoverFileExists() // Don't run auto#.g when a resume file exists + #endif + ) { char autoname[10]; - sprintf_P(autoname, PSTR("auto%i.g"), autostart_index); + sprintf_P(autoname, PSTR("auto%i.g"), int(autostart_index)); dir_t p; root.rewind(); while (root.readDir(&p, NULL) > 0) { @@ -767,7 +769,7 @@ void CardReader::setroot() { getfilename(i); #if ENABLED(SDSORT_DYNAMIC_RAM) // Use dynamic method to copy long filename - sortnames[i] = strdup(LONGEST_FILENAME); + sortnames[i] = strdup(longest_filename()); #if ENABLED(SDSORT_CACHE_NAMES) // When caching also store the short name, since // we're replacing the getfilename() behavior. @@ -776,10 +778,10 @@ void CardReader::setroot() { #else // Copy filenames into the static array #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0'; #else - strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); #endif #if ENABLED(SDSORT_CACHE_NAMES) strcpy(sortshort[i], filename); @@ -827,12 +829,12 @@ void CardReader::setroot() { // throughout the loop. Slow if there are many. #if DISABLED(SDSORT_USES_RAM) getfilename(o1); - strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) + strcpy(name1, longest_filename()); // save (or getfilename below will trounce it) #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; #endif getfilename(o2); - char *name2 = LONGEST_FILENAME; // use the string in-place + char *name2 = longest_filename(); // use the string in-place #endif // !SDSORT_USES_RAM // Sort the current pair according to settings. @@ -870,7 +872,7 @@ void CardReader::setroot() { getfilename(0); #if ENABLED(SDSORT_DYNAMIC_RAM) sortnames = new char*[1]; - sortnames[0] = strdup(LONGEST_FILENAME); // malloc + sortnames[0] = strdup(longest_filename()); // malloc #if ENABLED(SDSORT_CACHE_NAMES) sortshort = new char*[1]; sortshort[0] = strdup(filename); // malloc @@ -878,10 +880,10 @@ void CardReader::setroot() { isDir = new uint8_t[1]; #else #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0'; #else - strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); #endif #if ENABLED(SDSORT_CACHE_NAMES) strcpy(sortshort[0], filename); @@ -937,11 +939,7 @@ void CardReader::printingHasFinished() { sdprinting = false; #if ENABLED(POWER_LOSS_RECOVERY) - openJobRecoveryFile(false); - job_recovery_info.valid_head = job_recovery_info.valid_foot = 0; - (void)saveJobRecoveryInfo(); - closeJobRecoveryFile(); - job_recovery_commands_count = 0; + removeJobRecoveryFile(); #endif #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) @@ -994,20 +992,24 @@ void CardReader::printingHasFinished() { SERIAL_PROTOCOLCHAR('.'); SERIAL_EOL(); } - else + else if (!read) SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name); } void CardReader::closeJobRecoveryFile() { jobRecoveryFile.close(); } bool CardReader::jobRecoverFileExists() { - return jobRecoveryFile.open(&root, job_recovery_file_name, O_READ); + const bool exists = jobRecoveryFile.open(&root, job_recovery_file_name, O_READ); + if (exists) jobRecoveryFile.close(); + return exists; } int16_t CardReader::saveJobRecoveryInfo() { jobRecoveryFile.seekSet(0); const int16_t ret = jobRecoveryFile.write(&job_recovery_info, sizeof(job_recovery_info)); - if (ret == -1) SERIAL_PROTOCOLLNPGM("Power-loss file write failed."); + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + if (ret == -1) SERIAL_PROTOCOLLNPGM("Power-loss file write failed."); + #endif return ret; } @@ -1016,10 +1018,15 @@ void CardReader::printingHasFinished() { } void CardReader::removeJobRecoveryFile() { - if (jobRecoveryFile.remove(&root, job_recovery_file_name)) - SERIAL_PROTOCOLLNPGM("Power-loss file deleted."); - else - SERIAL_PROTOCOLLNPGM("Power-loss file delete failed."); + job_recovery_info.valid_head = job_recovery_info.valid_foot = job_recovery_commands_count = 0; + if (jobRecoverFileExists()) { + closefile(); + removeFile(job_recovery_file_name); + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + SERIAL_PROTOCOLPGM("Power-loss file delete"); + serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); + #endif + } } #endif // POWER_LOSS_RECOVERY diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 276b7b7b3d..8e29bd9a6f 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -121,6 +121,11 @@ class CardReader { FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } + #if defined(__STM32F1__) && ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION) + FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } + FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } + #endif + Sd2Card& getSd2Card() { return sd2card; } #if ENABLED(AUTO_REPORT_SD_STATUS) @@ -139,10 +144,12 @@ class CardReader { } #endif + FORCE_INLINE char* longest_filename() { return longFilename[0] ? longFilename : filename; } + public: bool saving, logging, sdprinting, cardOK, filenameIsDir; char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; - int autostart_index; + int8_t autostart_index; private: SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; uint8_t workDirDepth; diff --git a/buildroot/bin/env_backup b/buildroot/bin/env_backup new file mode 100755 index 0000000000..b41a452a4c --- /dev/null +++ b/buildroot/bin/env_backup @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +if [ ! -z "$1" ]; then + cd $1 +fi + +if [ -d ".test" ]; then + printf "\033[0;31mEnvironment backup already exists!\033[0m\n" +else + mkdir .test + cp Marlin/Configuration.h .test/Configuration.h + cp Marlin/Configuration_adv.h .test/Configuration_adv.h + + if [ -f Marlin/_Bootscreen.h ]; then + cp Marlin/_Bootscreen.h .test/_Bootscreen.h + fi + + if [ -f Marlin/_Statusscreen.h ]; then + cp Marlin/_Statusscreen.h .test/_Statusscreen.h + fi + + cp -r Marlin/src/pins .test/pins + printf "\033[0;32mEnvironment Backup created\033[0m\n" +fi diff --git a/buildroot/bin/env_clean b/buildroot/bin/env_clean new file mode 100755 index 0000000000..50b22e92f7 --- /dev/null +++ b/buildroot/bin/env_clean @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +if [ -d ".pioenvs" ]; then + rm -r .pioenvs +fi + +if [ -d ".piolibdeps" ]; then + rm -r .piolibdeps +fi + +if [ -d ".piolib" ]; then + rm -r .piolib +fi + +if [ ! -z "$1" ]; then + if [ $1 = "--deep" ]; then + if [ -d "~/.platformio/packages" ]; then + rm -r ~/.platformio/packages/* + fi + + if [ -d "~/.platformio/platforms" ]; then + rm -r ~/.platformio/platforms/* + fi + + if [ -d "~/.platformio/.cache" ]; then + rm -r ~/.platformio/.cache/* + fi + fi +fi diff --git a/buildroot/bin/env_restore b/buildroot/bin/env_restore new file mode 100755 index 0000000000..22bef325d6 --- /dev/null +++ b/buildroot/bin/env_restore @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +if [ ! -z "$1" ]; then + cd $1 +fi + +if [ -d ".test" ]; then + cp .test/Configuration.h Marlin/Configuration.h + cp .test/Configuration_adv.h Marlin/Configuration_adv.h + rm .test/Configuration.h + rm .test/Configuration_adv.h + + if [ -f .test/_Bootscreen.h ]; then + cp .test/_Bootscreen.h Marlin/_Bootscreen.h + rm .test/_Bootscreen.h + fi + + if [ -f .test/_Statusscreen.h ]; then + cp .test/_Statusscreen.h Marlin/_Statusscreen.h + rm .test/_Statusscreen.h + fi + + cp -r .test/pins Marlin/src + rm -r .test/pins + + rmdir .test + printf "\033[0;32mEnvironment Restored\033[0m\n" +else + printf "\033[0;31mEnvironment Backup not available!\033[0m\n" +fi diff --git a/buildroot/bin/restore_configs b/buildroot/bin/restore_configs index a77961a287..fa1f840582 100755 --- a/buildroot/bin/restore_configs +++ b/buildroot/bin/restore_configs @@ -2,8 +2,16 @@ cp Marlin/src/config/default/Configuration.h Marlin/Configuration.h cp Marlin/src/config/default/Configuration_adv.h Marlin/Configuration_adv.h -cp Marlin/src/pins/pins_RAMPS.h.backup Marlin/src/pins/pins_RAMPS.h -if [ -f Marlin/src/config/_Bootscreen.h ]; then - rm Marlin/src/config/_Bootscreen.h +if [ -f Marlin/src/pins/pins_RAMPS.h.backup ]; then + cp Marlin/src/pins/pins_RAMPS.h.backup Marlin/src/pins/pins_RAMPS.h + rm Marlin/src/pins/pins_RAMPS.h.backup +fi + +if [ -f Marlin/_Bootscreen.h ]; then + rm Marlin/_Bootscreen.h +fi + +if [ -f Marlin/_Statusscreen.h ]; then + rm Marlin/_Statusscreen.h fi diff --git a/buildroot/bin/use_example_configs b/buildroot/bin/use_example_configs index 405f36b2a9..453c627bed 100755 --- a/buildroot/bin/use_example_configs +++ b/buildroot/bin/use_example_configs @@ -5,5 +5,9 @@ restore_configs cp Marlin/src/config/examples/"$@"/Configuration* Marlin/ if [ -f "Marlin/src/config/examples/$@/_Bootscreen.h" ]; then - cp "Marlin/src/config/examples/$@/_Bootscreen.h" Marlin/src/config/ + cp "Marlin/src/config/examples/$@/_Bootscreen.h" Marlin/ +fi + +if [ -f "Marlin/src/config/examples/$@/_Statusscreen.h" ]; then + cp "Marlin/src/config/examples/$@/_Statusscreen.h" Marlin/ fi diff --git a/buildroot/share/PlatformIO/boards/at90USB1286.json b/buildroot/share/PlatformIO/boards/at90usb1286.json similarity index 77% rename from buildroot/share/PlatformIO/boards/at90USB1286.json rename to buildroot/share/PlatformIO/boards/at90usb1286.json index f8d82d1233..63c9ce44d1 100644 --- a/buildroot/share/PlatformIO/boards/at90USB1286.json +++ b/buildroot/share/PlatformIO/boards/at90usb1286.json @@ -1,14 +1,14 @@ { "build": { "core": "teensy", - "extra_flags": "-DTEENSY2PP", + "extra_flags": "-DTEENSY2PP -fsingle-precision-constant", "f_cpu": "16000000L", "mcu": "at90usb1286" }, "frameworks": [ "arduino" ], - "name": "at90USB1286.json", + "name": "Atmel AT90USB1286 based", "upload": { "maximum_ram_size": 8192, "maximum_size": 122880, diff --git a/buildroot/share/PlatformIO/boards/malyanM200.json b/buildroot/share/PlatformIO/boards/malyanM200.json new file mode 100644 index 0000000000..ccf118512f --- /dev/null +++ b/buildroot/share/PlatformIO/boards/malyanM200.json @@ -0,0 +1,78 @@ +{ + "build": { + "core": "maple", + "cpu": "cortex-m3", + "extra_flags": "-DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103CB", + "f_cpu": "72000000L", + "hwids": [ + ["0x1EAF", "0x0003"], + ["0x1EAF", "0x0004"] + ], + "ldscript": "jtagOffset.ld", + "mcu": "stm32f103cb", + "variant": "malyanM200", + "genericvariant" : "MALYAN_M200_V1", + "vec_tab_addr": "0x8002000" + }, + "debug": { + "tools": { + "stlink": { + "server": { + "arguments": [ + "-f", "scripts/interface/stlink.cfg", + "-c", "transport select hla_swd", + "-f", "scripts/target/stm32f1x.cfg", + "-c", "reset_config none" + ], + "executable": "bin/openocd", + "package": "tool-openocd" + } + }, + "stlink-v2": { + "server": { + "package": "tool-openocd", + "executable": "bin/openocd", + "arguments": [ + "-f", "scripts/interface/stlink-v2.cfg", + "-c", "transport select hla_swd", + "-f", "scripts/target/stm32f1x.cfg" + ] + }, + "default": true + }, + "stlink-v2-1": { + "server": { + "package": "tool-openocd", + "executable": "bin/openocd", + "arguments": [ + "-f", "scripts/interface/stlink-v2-1.cfg", + "-c", "transport select hla_swd", + "-f", "scripts/target/stm32f1x.cfg" + ] + } + }, + "blackmagic": { + "hwids": [ + [ + "0x1d50", + "0x6018" + ] + ], + "require_debug_port": true + } + } + }, + "frameworks": ["arduino", "arduinoSTM32GENERIC"], + "name": "Malyan STM32F103CB (20k RAM. 128k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 20480, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f1-series/stm32f103/stm32f103cb.html", + "vendor": "Generic" +} diff --git a/buildroot/share/PlatformIO/boards/malyanM200v2.json b/buildroot/share/PlatformIO/boards/malyanM200v2.json new file mode 100644 index 0000000000..ca768444bc --- /dev/null +++ b/buildroot/share/PlatformIO/boards/malyanM200v2.json @@ -0,0 +1,39 @@ +{ + "build": { + "cpu": "cortex-m0", + "extra_flags": "-DSTM32F070xB", + "f_cpu": "48000000L", + "mcu": "stm32f070rbt6", + "genericvariant" : "MALYAN_M200_V2", + "vec_tab_addr": "0x8002000" + }, + "debug": { + "default_tools": [ + "stlink" + ], + "onboard_tools": [ + "stlink" + ], + "openocd_board": "st_nucleo_f0", + "openocd_target": "stm32f0x" + }, + "frameworks": [ + "mbed", + "stm32cube", + "arduinoSTM32GENERIC" + ], + "name": "Malyan M200 V2/Delta", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "mbed", + "protocols": [ + "jlink", + "stlink", + "blackmagic", + "mbed" + ] + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F070RB/", + "vendor": "Malyan" +} diff --git a/buildroot/share/sublime/MarlinFirmware.sublime-project b/buildroot/share/sublime/MarlinFirmware.sublime-project index 2799e06a81..e4e362cd16 100644 --- a/buildroot/share/sublime/MarlinFirmware.sublime-project +++ b/buildroot/share/sublime/MarlinFirmware.sublime-project @@ -14,7 +14,9 @@ "folder_exclude_patterns": [ ".pio*", - "lib", + "MarlinFirmware/lib", + "Marlin/lib", + "src/lib", "datatmp", "Marlin/*/src", ".vscode" diff --git a/buildroot/share/sublime/RepRapTools/G-Code.sublime-syntax b/buildroot/share/sublime/RepRapTools/G-Code.sublime-syntax new file mode 100644 index 0000000000..ab1b499710 --- /dev/null +++ b/buildroot/share/sublime/RepRapTools/G-Code.sublime-syntax @@ -0,0 +1,149 @@ +%YAML 1.2 +--- +# +# G-Code (RepRap, not ISO-6983) +# +# RapRap G-Code is very simple. +# +# TODO: Lines that start with N get a different context, accepting a checksum. +# +name: G-Code (RepRap) +file_extensions: + - [ gco, gcode ] +scope: source.gcode +variables: + decimal: '[+-]?\d+(\.(\d+)?)?' + +contexts: + prototype: + - match: \s+ + + - include: mixin_comment + + - match: $ + pop: true + + main: + - meta_content_scope: ctx.line.gcode + + - match: '([Nn]\s*(\d+))' + captures: + 1: ctx.gcode_line_num + 2: constant.numeric.line-number.gcode + + - match: () + set: gcode_command + + # G, M, or T command + gcode_command: + - meta_content_scope: ctx.command.gcode + + # M20 S2 P/path/to/file/name.gco + - match: ([Mm](20))(\s*(S)(2)\s*(P)) + captures: + 1: entity.command.gcode markup.bold.gcode + 2: constant.numeric.command.gcode + 3: ctx.params.gcode + 4: keyword.param.gcode + 5: constant.numeric.param.gcode + 6: keyword.param.gcode + set: gcode_string_arg + + # command followed by data + - match: ([Mm]\s*(11[78]))\b + captures: + 1: entity.command.gcode markup.bold.gcode + 2: constant.numeric.command.gcode + set: gcode_string_arg + + # command followed by data + - match: '([GMTgmt]\s*(\d+)((\.)(\d+))?)' + captures: + 1: entity.command.gcode markup.bold.gcode + 2: constant.numeric.command.gcode + 4: entity.separator.subcode + 5: constant.numeric.subcode + set: gcode_params + + - match: () + set: syntax_error + + # Parameters of a command + gcode_params: + - meta_content_scope: ctx.params.gcode + + # M32 [S] [P] !/path/file.gco# + - match: '!' + scope: entity.string.filename.open + push: gcode_path_arg + + # asterisk starts a checksum + - match: \* + scope: entity.checksum.gcode + set: gcode_checksum + + # parameter and value + - match: ([A-Za-z])\s*({{decimal}}) + captures: + 1: keyword.param.gcode + 2: constant.numeric.param.gcode + + # parameter with no value + - match: '[A-Za-z]' + scope: keyword.param.gcode + set: gcode_params + + - match: () + set: syntax_error + + gcode_string_arg: + - meta_content_scope: ctx.string.gcode + + - match: ([^;]+) + scope: string.unquoted.gcode + + gcode_path_arg: + - meta_content_scope: ctx.path.gcode + + - match: ([^#]+) + scope: string.unquoted.path.gcode + + - match: (#) + scope: entity.string.path.close.gcode + pop: true + + gcode_checksum: + - meta_content_scope: ctx.checksum.gcode + + - match: \d+ + scope: constant.numeric.checksum.gcode + + - match: () + set: syntax_error + + # Done interpreting to the end of the line + gcode_line_done: + - match: \s*$ + pop: true + + # Comments begin with a ';' and finish at the end of the line. + mixin_comment: + - match: ^\s*; + scope: punctuation.definition.comment.line.start + set: gcode_comment + - match: \s*; + scope: punctuation.definition.comment.eol.start + set: gcode_comment + + # Comment to end of line. + gcode_comment: + - meta_scope: comment.gcode + - match: \s*$ + pop: true + + # Everything after this point is broken by a syntax error + syntax_error: + - meta_scope: invalid.error.syntax.gcode + + - match: .*$ + pop: true diff --git a/buildroot/share/tests/DUE_tests b/buildroot/share/tests/DUE_tests new file mode 100755 index 0000000000..7b172fe6ab --- /dev/null +++ b/buildroot/share/tests/DUE_tests @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# exit on first failure +set -e + +restore_configs +opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB +opt_enable S_CURVE_ACCELERATION +opt_set E0_AUTO_FAN_PIN 8 +opt_set EXTRUDER_AUTO_FAN_SPEED 100 +exec_test $1 $2 "RAMPS4DUE_EFB S_CURVE_ACCELERATION" diff --git a/buildroot/share/tests/LPC1768_tests b/buildroot/share/tests/LPC1768_tests new file mode 100755 index 0000000000..07d891c61a --- /dev/null +++ b/buildroot/share/tests/LPC1768_tests @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# exit on first failure +set -e + +restore_configs +opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB +exec_test $1 $2 "Build Re-ARM Default Configuration" + +restore_configs +opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB +opt_enable VIKI2 SDSUPPORT +exec_test $1 $2 "VIKI2 and SDSUPPORT" + +restore_configs +opt_set MOTHERBOARD BOARD_MKS_SBASE +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT +exec_test $1 $2 "MKS SBASE RRDFG SDSUPPORT" + +#clean up +restore_configs diff --git a/buildroot/share/tests/STM32F1_tests b/buildroot/share/tests/STM32F1_tests new file mode 100755 index 0000000000..0d1fd90991 --- /dev/null +++ b/buildroot/share/tests/STM32F1_tests @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# exit on first failure +set -e + +restore_configs +opt_set MOTHERBOARD BOARD_STM32F1R +opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT +exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT" + +#cleanup +restore_configs diff --git a/buildroot/share/tests/megaatmega2560_tests b/buildroot/share/tests/megaatmega2560_tests new file mode 100755 index 0000000000..faf7cd0af0 --- /dev/null +++ b/buildroot/share/tests/megaatmega2560_tests @@ -0,0 +1,315 @@ +#!/usr/bin/env bash + +# exit on first failure +set -e + +# +# Backup pins_RAMPS.h +# +cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup +# +# Build with the default configurations +# +restore_configs +exec_test $1 $2 "Default Configuration" +# +# Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4 +# Test a "Fix Mounted" Probe with Safe Homing, some arc options, +# linear bed leveling, M48, leveling debug, and firmware retraction. +# +opt_set MOTHERBOARD BOARD_RAMPS_14_EEB +opt_set EXTRUDERS 2 +opt_set TEMP_SENSOR_0 -2 +opt_set TEMP_SENSOR_1 1 +opt_set TEMP_SENSOR_BED 1 +opt_set POWER_SUPPLY 1 +opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS PINS_DEBUGGING +opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR +opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE +opt_enable_adv ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE +opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING +opt_set GRID_MAX_POINTS_X 16 +opt_set_adv FANMUX0_PIN 53 +exec_test $1 $2 "Extruders(2) MAX6675 Fixed Probe etc" +# +# Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders +# +restore_configs +opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO +opt_set EXTRUDERS 5 +opt_set TEMP_SENSOR_1 1 +opt_set TEMP_SENSOR_2 5 +opt_set TEMP_SENSOR_3 20 +opt_set TEMP_SENSOR_4 999 +opt_set TEMP_SENSOR_BED 1 +opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION +opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT +opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI +opt_enable_adv CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING BABYSTEP_XY LIN_ADVANCE NANODLP_Z_SYNC QUICK_HOME JUNCTION_DEVIATION +exec_test $1 $2 "Probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders" +# +# Add a Sled Z Probe, use UBL Cartesian moves, use Japanese language +# +opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE +opt_set LCD_LANGUAGE jp-kana +opt_disable SEGMENT_LEVELED_MOVES +opt_enable_adv BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING +exec_test $1 $2 "Add a Sled Z Probe, use UBL Cartesian moves, use Japanese language" +# +# Test a Servo Probe +# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES +# +restore_configs +opt_enable NUM_SERVOS Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE +opt_set NUM_SERVOS 1 +opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT +opt_enable_adv NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET +exec_test $1 $2 "Servo Probe with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS etc" +# +# Test MESH_BED_LEVELING feature, with LCD +# +restore_configs +opt_enable MESH_BED_LEVELING G26_MESH_EDITING MESH_G28_REST_ORIGIN LCD_BED_LEVELING ULTIMAKERCONTROLLER +exec_test $1 $2 "MESH_BED_LEVELING feature, with LCD" +# +# Test MINIRAMBO for PWM_MOTOR_CURRENT +# PROBE_MANUALLY feature, with LCD support, +# ULTIMAKERCONTROLLER, FILAMENT_LCD_DISPLAY, FILAMENT_WIDTH_SENSOR, +# PRINTCOUNTER, NOZZLE_PARK_FEATURE, NOZZLE_CLEAN_FEATURE, PCA9632, +# Z_DUAL_ENDSTOPS, BEZIER_CURVE_SUPPORT, EXPERIMENTAL_I2CBUS, +# ADVANCED_PAUSE_FEATURE, ADVANCED_PAUSE_CONTINUOUS_PURGE, PARK_HEAD_ON_PAUSE, LCD_INFO_MENU, +# EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, +# INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT +# +restore_configs +opt_set MOTHERBOARD BOARD_MINIRAMBO +opt_enable PROBE_MANUALLY AUTO_BED_LEVELING_BILINEAR G26_MESH_EDITING LCD_BED_LEVELING ULTIMAKERCONTROLLER +opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT +opt_enable ULTIMAKERCONTROLLER SDSUPPORT +opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 +opt_enable_adv BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS +opt_enable_adv ADVANCED_PAUSE_FEATURE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE LCD_INFO_MENU M114_DETAIL +opt_set_adv PWM_MOTOR_CURRENT {1300,1300,1250} +opt_set_adv I2C_SLAVE_ADDRESS 63 +exec_test $1 $2 "MINIRAMBO for PWM_MOTOR_CURRENT etc" +# +# Mixing Extruder with 5 steppers, Cyrillic +# +restore_configs +opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO +opt_enable MIXING_EXTRUDER CR10_STOCKDISPLAY +opt_set MIXING_STEPPERS 5 +opt_set LCD_LANGUAGE ru +exec_test $1 $2 "Mixing Extruder with 5 steppers, Cyrillic" +# +# Test DUAL_X_CARRIAGE +# +restore_configs +opt_set MOTHERBOARD BOARD_RUMBA +opt_set EXTRUDERS 2 +opt_set TEMP_SENSOR_1 1 +opt_enable USE_XMAX_PLUG +opt_enable_adv DUAL_X_CARRIAGE +exec_test $1 $2 "DUAL_X_CARRIAGE" +# +# Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER +# +#restore_configs +#opt_set MOTHERBOARD BOARD_BQ_ZUM_MEGA_3D +#opt_set LCD_FEEDBACK_FREQUENCY_DURATION_MS 10 +#opt_set LCD_FEEDBACK_FREQUENCY_HZ 100 +#opt_enable BQ_LCD_SMART_CONTROLLER SPEAKER +# +# Test SWITCHING_EXTRUDER +# +restore_configs +opt_set MOTHERBOARD BOARD_RUMBA +opt_set EXTRUDERS 2 +opt_enable NUM_SERVOS +opt_set NUM_SERVOS 1 +opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER +exec_test $1 $2 "SWITCHING_EXTRUDER" +# +# Enable COREXY +# +#restore_configs +#opt_enable COREXY +#exec_test $1 $2 "Stuff" +# +# Test many less common options +# +restore_configs +opt_enable COREYX +opt_set_adv FAN_MIN_PWM 50 +opt_set_adv FAN_KICKSTART_TIME 100 +opt_set_adv XY_FREQUENCY_LIMIT 15 +opt_enable_adv SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME +opt_enable_adv ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK +opt_enable_adv VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL +opt_enable_adv EXTRA_FAN_SPEED FWERETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS +opt_enable_adv MENU_ADDAUTOSTART SDCARD_SORT_ALPHA +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT +opt_enable FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR +opt_enable ENDSTOP_INTERRUPTS_FEATURE FAN_SOFT_PWM SDSUPPORT +opt_enable USE_XMAX_PLUG +exec_test $1 $2 "Many less common options" +# +######## Other Standard LCD/Panels ############## +# +# ULTRA_LCD +# +#restore_configs +#opt_enable ULTRA_LCD +#exec_test $1 $2 "Stuff" +# +# DOGLCD +# +#restore_configs +#opt_enable DOGLCD +#exec_test $1 $2 "Stuff" +# +# MAKRPANEL +# Needs to use Melzi and Sanguino hardware +# +#restore_configs +#opt_enable MAKRPANEL +#exec_test $1 $2 "Stuff" +# +# REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, BABYSTEPPING, RIGIDBOARD_V2, and DAC_MOTOR_CURRENT_DEFAULT +# +#restore_configs +#opt_set MOTHERBOARD BOARD_RIGIDBOARD_V2 +#opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT +#exec_test $1 $2 "Stuff" +# # +# G3D_PANEL with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING +# +#restore_configs +#opt_enable G3D_PANEL SDSUPPORT +#opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES +#opt_set_adv SDSORT_GCODE true +#opt_set_adv SDSORT_USES_RAM true +#opt_set_adv SDSORT_USES_STACK true +#opt_set_adv SDSORT_CACHE_NAMES true +#exec_test $1 $2 "Stuff" +# +# Test a full-featured CR-10S config +# +use_example_configs Creality/CR-10S +opt_enable SHOW_CUSTOM_BOOTSCREEN +exec_test $1 $2 "Full-featured CR-10S config" +# +# REPRAPWORLD_KEYPAD +# +# Cant find configuration details to get it to compile +#restore_configs +#opt_enable ULTRA_LCD REPRAPWORLD_KEYPAD REPRAPWORLD_KEYPAD_MOVE_STEP +#exec_test $1 $2 "Stuff" +# +# RA_CONTROL_PANEL +# +#restore_configs +#opt_enable RA_CONTROL_PANEL PINS_DEBUGGING +#exec_test $1 $2 "Stuff" +# +######## I2C LCD/PANELS ############## +# +# !!!ATTENTION!!! +# Most I2C configurations are failing at the moment because they require +# a different Liquid Crystal library "LiquidTWI2". +# +# LCD_SAINSMART_I2C_1602 +# +#restore_configs +#opt_enable LCD_SAINSMART_I2C_1602 +#exec_test $1 $2 "Stuff" +# +# LCD_I2C_PANELOLU2 +# +#restore_configs +#opt_enable LCD_I2C_PANELOLU2 +#exec_test $1 $2 "Stuff" +# +# LCD_I2C_VIKI +# +#restore_configs +#opt_enable LCD_I2C_VIKI +#exec_test $1 $2 "Stuff" +# +# LCM1602 +# +#restore_configs +#opt_enable LCM1602 +#exec_test $1 $2 "Stuff" +# +# Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +# +#restore_configs +#opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT +#for lang in an bg ca zh_CN zh_TW cz da de el el-gr en es eu fi fr gl hr it jp-kana nl pl pt pt-br ru sk tr uk test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done +# +#restore_configs +#opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT +#for lang in an bg ca zh_CN zh_TW cz da de el el-gr en es eu fi fr gl hr it jp-kana nl pl pt pt-br ru sk tr uk test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done +# +# +######## Example Configurations ############## +# +# BQ Hephestos 2 +#restore_configs +#use_example_configs Hephestos_2 +#exec_test $1 $2 "Stuff" +# +# Delta Config (generic) + ABL bilinear + PROBE_MANUALLY +use_example_configs delta/generic +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY +exec_test $1 $2 "Delta Config (generic) + ABL bilinear + PROBE_MANUALLY" +# +# Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS +# +use_example_configs delta/generic +opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 Z_PROBE_ALLEN_KEY EEPROM_SETTINGS EEPROM_CHITCHAT +opt_enable OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY +exec_test $1 $2 "Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS" +# +# Delta Config (FLSUN AC because it's complex) +# +use_example_configs delta/FLSUN/auto_calibrate +exec_test $1 $2 "Delta Config (FLSUN AC because it's complex)" +# +# Makibox Config need to check board type for Teensy++ 2.0 +# +#use_example_configs makibox +#exec_test $1 $2 "Stuff" +# +# SCARA with TMC2130 +# +use_example_configs SCARA +opt_enable AUTO_BED_LEVELING_BILINEAR FIX_MOUNTED_PROBE USE_ZMIN_PLUG EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER +opt_set X_DRIVER_TYPE TMC2130 +opt_set Y_DRIVER_TYPE TMC2130 +opt_set Z_DRIVER_TYPE TMC2130 +opt_set E0_DRIVER_TYPE TMC2130 +opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING +exec_test $1 $2 "SCARA with TMC2130" +# +# TMC2208 Config +# +restore_configs +opt_set X_DRIVER_TYPE TMC2208 +opt_set Y_DRIVER_TYPE TMC2208 +opt_set Z_DRIVER_TYPE TMC2208 +opt_set E0_DRIVER_TYPE TMC2208 +opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG +exec_test $1 $2 "TMC2208 Config" +# +# tvrrug Config need to check board type for sanguino atmega644p +# +#use_example_configs tvrrug/Round2 +#exec_test $1 $2 "Stuff" +# +# + +#clean up +restore_configs diff --git a/buildroot/share/tests/start_tests b/buildroot/share/tests/start_tests new file mode 100755 index 0000000000..83d33f91c7 --- /dev/null +++ b/buildroot/share/tests/start_tests @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +export PATH="$PATH:$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )" +export PATH="$PATH:./buildroot/bin" + +# exit on first failure +set -e + +exec_test () { + printf "\033[0;32m[Test $2] \033[0m$3... " + if build_marlin_pio $1 "-e $2"; then + printf "\033[0;32mPassed\033[0m\n" + return 0 + else + env_restore + printf "\033[0;31mFailed!\033[0m\n" + return 1 + fi +} +export -f exec_test + +env_backup +printf "Running \033[0;32m$2\033[0m Tests\n" +if [ $2 = "ALL" ]; then + dir_list=("$(dirname "${BASH_SOURCE[0]}")"/*) + declare -a tests=(${dir_list[@]/*start_tests/}) + for f in "${tests[@]}"; do + testenv=$(basename $f | cut -d"_" -f1) + printf "Running \033[0;32m$f\033[0m Tests\n" + exec_test $1 "$testenv --target clean" "Setup Build Environment" + $f $1 $testenv + done +else + exec_test $1 "$2 --target clean" "Setup Build Environment" + $2_tests $1 $2 +fi +printf "\033[0;32mAll tests completed successfully\033[0m\n" +env_restore diff --git a/buildroot/share/tests/teensy35_tests b/buildroot/share/tests/teensy35_tests new file mode 100755 index 0000000000..51930dd840 --- /dev/null +++ b/buildroot/share/tests/teensy35_tests @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +# exit on first failure +set -e + +restore_configs +opt_set MOTHERBOARD BOARD_TEENSY35_36 +cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup +# +# Test Teensy3.5 with default config +# +exec_test $1 $2 "Teensy3.5 with default config" +# +# Test as many features together as possible +# +restore_configs +opt_set EXTRUDERS 2 +opt_set TEMP_SENSOR_0 1 +opt_set TEMP_SENSOR_1 5 +opt_set TEMP_SENSOR_BED 1 +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT +opt_enable FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY +opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE +opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY +opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER +opt_enable_adv ADVANCED_PAUSE_FEATURE LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA PARK_HEAD_ON_PAUSE +opt_set_adv I2C_SLAVE_ADDRESS 63 +opt_set GRID_MAX_POINTS_X 16 +exec_test $1 $2 "As many features together as possible" +# +# Test a Sled Z Probe with Linear leveling +# +restore_configs +opt_enable Z_PROBE_SLED +opt_enable AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE EEPROM_SETTINGS +exec_test $1 $2 "Sled Z Probe with Linear leveling" +# +# Test a Servo Probe +# +restore_configs +opt_enable NUM_SERVOS Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE +opt_set NUM_SERVOS 1 +opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS +exec_test $1 $2 "Servo Probe" +# +# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES +# +opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS +opt_enable_adv EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES +exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES" +# +# Test MESH_BED_LEVELING feature, with LCD +# +restore_configs +opt_enable MESH_BED_LEVELING MESH_G28_REST_ORIGIN MANUAL_BED_LEVELING ULTIMAKERCONTROLLER +exec_test $1 $2 "MESH_BED_LEVELING feature, with LCD" +# +# Mixing Extruder +# +restore_configs +opt_enable MIXING_EXTRUDER DIRECT_MIXING_IN_G1 +opt_set MIXING_STEPPERS 2 +exec_test $1 $2 "Mixing Extruder" +# +# Test SWITCHING_EXTRUDER +# +restore_configs +opt_set EXTRUDERS 2 +opt_enable NUM_SERVOS +opt_set NUM_SERVOS 1 +opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER +exec_test $1 $2 "SWITCHING_EXTRUDER" +# +# Enable COREXY +# +restore_configs +opt_enable COREXY +exec_test $1 $2 "COREXY" +# +# Enable COREXZ +# +restore_configs +opt_enable COREXZ +exec_test $1 $2 "COREXZ" +# +# Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS +# +restore_configs +opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS +pins_set RAMPS X_MAX_PIN -1 +opt_add_adv Z2_MAX_PIN 2 +opt_enable USE_XMAX_PLUG +exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS" + +#cleanup +restore_configs diff --git a/platformio.ini b/platformio.ini index 28cf36db33..979e5499e0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -81,10 +81,10 @@ monitor_speed = 250000 # - SAV_MKI # - TEENSYLU # -[env:at90USB1286_CDC] +[env:at90usb1286_cdc] platform = teensy framework = arduino -board = at90USB1286 +board = at90usb1286 build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} lib_ldf_mode = deep+ @@ -98,10 +98,10 @@ monitor_speed = 250000 # - PrintrBoard Rev.F # - ? 5DPRINT ? # -[env:at90USB1286_DFU] +[env:at90usb1286_dfu] platform = teensy framework = arduino -board = at90USB1286 +board = at90usb1286 build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} lib_ldf_mode = deep+ @@ -163,6 +163,7 @@ lib_extra_dirs = frameworks lib_deps = CMSIS-LPC1768 https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip TMC2130Stepper@>=2.2.1 + TMC2208Stepper@>=0.2.1 extra_scripts = Marlin/src/HAL/HAL_LPC1768/debug_extra_script.py, Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py, Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py src_filter = ${common.default_src_filter} monitor_speed = 250000 @@ -274,20 +275,6 @@ lib_ignore = Adafruit NeoPixel, c1921b4, TMC2130Stepper src_filter = ${common.default_src_filter} monitor_speed = 250000 -# -# Teensy++ 2.0 -# -[env:teensy20] -platform = teensy -framework = arduino -board = teensy20pp -build_flags = ${common.build_flags} -#board_build.f_cpu = 20000000L ; Bug in Arduino framework disallows boards running at 20Mhz -lib_deps = ${common.lib_deps} -lib_ldf_mode = deep+ -src_filter = ${common.default_src_filter} -monitor_speed = 250000 - # # Teensy 3.5 / 3.6 (ARM Cortex-M4) #