From ad656d76c733d12dc57afa14f7299c3ca1aa8c7f Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Fri, 22 Sep 2017 11:00:56 -0600 Subject: [PATCH 1/2] Initial check in of branch for EinsyRambo. --- Marlin/Conditionals_LulzBot.h | 188 +++++++++++++++++++++++---------- Marlin/Configuration_adv.h | 26 +++-- Marlin/Makefile | 13 ++- Marlin/MarlinConfig.h | 2 +- Marlin/Marlin_main.cpp | 1 - Marlin/boards.h | 1 + Marlin/endstops.cpp | 2 + Marlin/pins.h | 2 + Marlin/stepper_indirection.cpp | 1 - 9 files changed, 164 insertions(+), 72 deletions(-) diff --git a/Marlin/Conditionals_LulzBot.h b/Marlin/Conditionals_LulzBot.h index 017fa5925..9e9d2c9c1 100644 --- a/Marlin/Conditionals_LulzBot.h +++ b/Marlin/Conditionals_LulzBot.h @@ -18,6 +18,7 @@ #if ( \ !defined(LULZBOT_Gladiola_Mini) && \ !defined(LULZBOT_Hibiscus_Mini2) && \ + !defined(LULZBOT_Gladiola_MiniEinsy) && \ !defined(LULZBOT_Gladiola_MiniLCD) && \ !defined(LULZBOT_Hibiscus_Mini2LCD) && \ !defined(LULZBOT_Juniper_TAZ5) && \ @@ -39,7 +40,7 @@ #error Must specify model and toolhead. Please see "Configuration_LulzBot.h" for directions. #endif -#define LULZBOT_FW_VERSION ".12" +#define LULZBOT_FW_VERSION ".13" // Select options based on printer model @@ -68,6 +69,19 @@ #define LULZBOT_UUID "1b8d32d3-0596-4335-8cd4-f3741a095087" #endif +#if defined(LULZBOT_Gladiola_MiniEinsy) + #define LULZBOT_CUSTOM_MACHINE_NAME "LulzBot Mini" + #define LULZBOT_LCD_MACHINE_NAME "Mini Einsy" + #define LULZBOT_IS_MINI + //#define LULZBOT_USE_MAX_ENDSTOPS + #define LULZBOT_MINI_BED + #define LULZBOT_USE_LCD_DISPLAY + #define LULZBOT_USE_AUTOLEVELING + #define LULZBOT_SENSORLESS_HOMING + #define LULZBOT_BAUDRATE 115200 + #define LULZBOT_UUID "4479bf92-7e47-4c2c-be95-64dd01bd413b" +#endif + #if defined(LULZBOT_Gladiola_MiniLCD) #define LULZBOT_CUSTOM_MACHINE_NAME "LulzBot Mini" #define LULZBOT_LCD_MACHINE_NAME "Mini LCD" @@ -237,7 +251,13 @@ #undef LULZBOT_USE_HOME_BUTTON #endif -#if defined(LULZBOT_IS_MINI) +#if defined(LULZBOT_Gladiola_MiniEinsy) + // Experimental Mini retrofitted with EinsyRambo from UltiMachine + #define LULZBOT_MOTHERBOARD BOARD_EINSYRAMBO + #define LULZBOT_CONTROLLER_FAN_PIN FAN1_PIN // Digital pin 6 + #define LULZBOT_HAVE_TMC2130 + +#elif defined(LULZBOT_IS_MINI) #define LULZBOT_MOTHERBOARD BOARD_MINIRAMBO #define LULZBOT_CONTROLLER_FAN_PIN FAN1_PIN // Digital pin 6 @@ -260,52 +280,16 @@ #endif #define LULZBOT_USE_CONTROLLER_FAN -#define LULZBOT_USE_XMIN_PLUG -#define LULZBOT_USE_YMIN_PLUG -#define LULZBOT_USE_ZMIN_PLUG - -// Z-Max Endstops were introduced on the Mini and TAZ 6 -#if defined(LULZBOT_USE_MAX_ENDSTOPS) - #define LULZBOT_USE_XMAX_PLUG - #define LULZBOT_USE_YMAX_PLUG - #define LULZBOT_USE_ZMAX_PLUG -#endif - -#define LULZBOT_ENDSTOPS_ALWAYS_ON_DEFAULT -#define LULZBOT_ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - -// Workaround for bug in Marlin 1.1.5 where motion is stopped a X or Y = 0 -#define LULZBOT_MIN_SOFTWARE_ENDSTOPS_DISABLED - -// The RAMBO does not support interrupts on all pins -// so leave the ENDSTOP_INTERRUPTS_FEATURE disabled - -//#define LULZBOT_ENDSTOP_INTERRUPTS_FEATURE - -/* Endstop settings are determined by printer model, except for the - * X_MAX which varies by toolhead. */ -#if defined(LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS) - // TAZ 6+ and Huerfano Mini onwards use normally closed endstops. - // This is safer, as a loose connector or broken wire will halt - // the axis - #define LULZBOT_X_MIN_ENDSTOP_INVERTING false - #define LULZBOT_Y_MIN_ENDSTOP_INVERTING false - #define LULZBOT_Y_MAX_ENDSTOP_INVERTING false - #define LULZBOT_Z_MAX_ENDSTOP_INVERTING false +#if defined(LULZBOT_Gladiola_MiniEinsy) + #define LULZBOT_INVERT_X_DIR true + #define LULZBOT_INVERT_Y_DIR false + #define LULZBOT_INVERT_Z_DIR true #else - #define LULZBOT_X_MIN_ENDSTOP_INVERTING true - #define LULZBOT_Y_MIN_ENDSTOP_INVERTING true - #define LULZBOT_Y_MAX_ENDSTOP_INVERTING true - #define LULZBOT_Z_MAX_ENDSTOP_INVERTING true + #define LULZBOT_INVERT_X_DIR false + #define LULZBOT_INVERT_Y_DIR true + #define LULZBOT_INVERT_Z_DIR false #endif - -#define LULZBOT_Z_MIN_ENDSTOP_INVERTING true -#define LULZBOT_Z_MIN_PROBE_ENDSTOP_INVERTING true - -#define LULZBOT_INVERT_X_DIR false -#define LULZBOT_INVERT_Y_DIR true -#define LULZBOT_INVERT_Z_DIR false #define LULZBOT_INVERT_E0_DIR true #define LULZBOT_INVERT_E1_DIR true @@ -431,7 +415,7 @@ /* On the Finch Aero toolhead, we need to disable the extruder * motor as it causes noise on the probe line on Foxglove Minis. */ -#if defined(LULZBOT_IS_MINI) && defined(TOOLHEAD_Finch_Aerostruder) +#if (defined(LULZBOT_IS_MINI) && defined(TOOLHEAD_Finch_Aerostruder)) || defined(LULZBOT_Gladiola_MiniEinsy) #define LULZBOT_EXTRUDER_MOTOR_SHUTOFF_ON_PROBE(probing) \ if(probing) { \ disable_E0(); \ @@ -452,7 +436,7 @@ * Z_MIN_PIN corresponds to the Z-Home push button. * Z_MIN_PROBE_PIN are the bed washers. */ -#if defined(LULZBOT_USE_AUTOLEVELING) && defined(LULZBOT_MINI_BED) +#if defined(LULZBOT_USE_AUTOLEVELING) && defined(LULZBOT_MINI_BED) && !defined(LULZBOT_Gladiola_MiniEinsy) #define LULZBOT_ENABLE_PROBE_PINS(enable) { \ if(enable) { \ /* Set as inputs with pull-up resistor */ \ @@ -486,6 +470,7 @@ endstops.enable_z_probe(false); \ } \ } + #error Foo #else #define LULZBOT_ENABLE_PROBE_PINS(enable) #endif @@ -559,7 +544,7 @@ #define LULZBOT_TOOLHEAD_WIPE_X2_ADJ 0 #define LULZBOT_TOOLHEAD_WIPE_Y1_ADJ 0 #define LULZBOT_TOOLHEAD_WIPE_Y2_ADJ 0 - #define PWM_MOTOR_CURRENT_E 1250 + #define LULZBOT_MOTOR_CURRENT_E 1250 #endif /* TOOLHEAD_Gladiola_SingleExtruder || TOOLHEAD_Albatross_Flexystruder || TOOLHEAD_Finch_Aerostruder */ #if defined(TOOLHEAD_Gladiola_SingleExtruder) @@ -792,7 +777,7 @@ #define LULZBOT_Y_BED_SIZE 280 #endif -#if defined(LULZBOT_Gladiola_Mini) || defined(LULZBOT_Gladiola_MiniLCD) +#if defined(LULZBOT_Gladiola_Mini) || defined(LULZBOT_Gladiola_MiniLCD) || defined(LULZBOT_Gladiola_MiniEinsy) #define LULZBOT_STANDARD_Z_MIN_POS -2 #define LULZBOT_STANDARD_Z_MAX_POS 159 @@ -820,6 +805,95 @@ #define LULZBOT_Z_MAX_POS (LULZBOT_STANDARD_Z_MAX_POS - LULZBOT_TOOLHEAD_Z_MAX_ADJ) #define LULZBOT_Z_MIN_POS (LULZBOT_STANDARD_Z_MIN_POS - LULZBOT_TOOLHEAD_Z_MIN_ADJ) +/**************************** ENDSTOP CONFIGURATION ****************************/ + +#if defined(LULZBOT_SENSORLESS_HOMING) + #define LULZBOT_USE_XMIN_PLUG // Uses Stallguard + //#define LULZBOT_USE_XMAX_PLUG // Uses Stallguard + //#define LULZBOT_USE_YMIN_PLUG // Uses Stallguard + #define LULZBOT_USE_YMAX_PLUG // Uses Stallguard + #define LULZBOT_USE_ZMIN_PLUG + #define LULZBOT_USE_ZMAX_PLUG +#else + #define LULZBOT_USE_XMIN_PLUG + #define LULZBOT_USE_YMIN_PLUG + #define LULZBOT_USE_ZMIN_PLUG +#endif + +// Z-Max Endstops were introduced on the Mini and TAZ 6 +#if defined(LULZBOT_USE_MAX_ENDSTOPS) + #define LULZBOT_USE_XMAX_PLUG + #define LULZBOT_USE_YMAX_PLUG + #define LULZBOT_USE_ZMAX_PLUG +#endif + +#define LULZBOT_ENDSTOPS_ALWAYS_ON_DEFAULT +#define LULZBOT_ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + +// Workaround for bug in Marlin 1.1.5 where motion is stopped a X or Y = 0 +#define LULZBOT_MIN_SOFTWARE_ENDSTOPS_DISABLED + +// The RAMBO does not support interrupts on all pins +// so leave the ENDSTOP_INTERRUPTS_FEATURE disabled + +//#define LULZBOT_ENDSTOP_INTERRUPTS_FEATURE + +/* Endstop settings are determined by printer model, except for the + * X_MAX which varies by toolhead. */ + +#if defined(LULZBOT_SENSORLESS_HOMING) + #define LULZBOT_X_MIN_ENDSTOP_INVERTING false + #define LULZBOT_X_MAX_ENDSTOP_INVERTING false + #define LULZBOT_Y_MAX_ENDSTOP_INVERTING false + #define LULZBOT_Y_MIN_ENDSTOP_INVERTING false + + #define LULZBOT_Z_MAX_ENDSTOP_INVERTING true + #define LULZBOT_Z_MIN_ENDSTOP_INVERTING true + #define LULZBOT_Z_MIN_PROBE_ENDSTOP_INVERTING true + + // The following does not seem to work when both + // MAX and MIN are using Stallguard: + //#define LULZBOT_ENDSTOP_INTERRUPTS_FEATURE + + // Fix for issue where repeated endstop reports cause Cura + // to fail to connect. + #define LULZBOT_SUPPRESS_CHATTY_ENDSTOPS + + // For some reason, Quickhome is not reliable with sensorless homing + #undef LULZBOT_QUICKHOME + +#elif defined(LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS) + // TAZ 6+ and Huerfano Mini onwards use normally closed endstops. + // This is safer, as a loose connector or broken wire will halt + // the axis + #define LULZBOT_X_MIN_ENDSTOP_INVERTING false + #define LULZBOT_Y_MIN_ENDSTOP_INVERTING false + #define LULZBOT_Z_MIN_ENDSTOP_INVERTING true + #define LULZBOT_Z_MIN_PROBE_ENDSTOP_INVERTING true + + // LULZBOT_X_MAX_ENDSTOP_INVERTING varies by toolhead + #define LULZBOT_Y_MAX_ENDSTOP_INVERTING false + #define LULZBOT_Z_MAX_ENDSTOP_INVERTING false +#else + #define LULZBOT_X_MIN_ENDSTOP_INVERTING true + #define LULZBOT_Y_MIN_ENDSTOP_INVERTING true + #define LULZBOT_Z_MIN_ENDSTOP_INVERTING true + #define LULZBOT_Z_MIN_PROBE_ENDSTOP_INVERTING true + + // LULZBOT_X_MAX_ENDSTOP_INVERTING varies by toolhead + #define LULZBOT_Y_MAX_ENDSTOP_INVERTING true + #define LULZBOT_Z_MAX_ENDSTOP_INVERTING true +#endif + +#if defined(LULZBOT_SENSORLESS_HOMING) + #define LULZBOT_X_HOME_BUMP_MM 0 + #define LULZBOT_Y_HOME_BUMP_MM 0 + +#else + #define LULZBOT_X_HOME_BUMP_MM 5 + #define LULZBOT_Y_HOME_BUMP_MM 5 +#endif + /**************************** ADVANCED PAUSE FEATURE ****************************/ #if defined(LULZBOT_USE_LCD_DISPLAY) @@ -924,7 +998,7 @@ // by printer model (steps and motor currents for E vary by toolhead). #if defined(LULZBOT_IS_MINI) - #define PWM_MOTOR_CURRENT_XY 1300 + #define LULZBOT_MOTOR_CURRENT_XY 1300 #define LULZBOT_XY_STEPS 100.5 #define LULZBOT_DEFAULT_MAX_FEEDRATE {300, 300, 8, 40} // (mm/sec) #define LULZBOT_DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} @@ -954,12 +1028,12 @@ #define LULZBOT_Z_PROBE_OFFSET_FROM_EXTRUDER -1.200 #endif -#if defined(LULZBOT_Gladiola_Mini) || defined(LULZBOT_Gladiola_MiniLCD) - #define PWM_MOTOR_CURRENT_Z 1630 +#if defined(LULZBOT_Gladiola_Mini) || defined(LULZBOT_Gladiola_MiniLCD) || defined(LULZBOT_Gladiola_MiniEinsy) + #define LULZBOT_MOTOR_CURRENT_Z 1630 #define LULZBOT_Z_STEPS 1600 #elif defined(LULZBOT_Hibiscus_Mini2) || defined(LULZBOT_Hibiscus_Mini2LCD) - #define PWM_MOTOR_CURRENT_Z 1000 + #define LULZBOT_MOTOR_CURRENT_Z 1000 // Prototype Z-Belt Mini #define Z_FULL_STEPS_PER_ROTATION 200 #define Z_MICROSTEPS 16 @@ -991,11 +1065,11 @@ #define LULZBOT_Z_STEPS 1790.08264463 #endif -#if defined(PWM_MOTOR_CURRENT_XY) && defined(PWM_MOTOR_CURRENT_Z) && defined(PWM_MOTOR_CURRENT_E) +#if defined(LULZBOT_MOTOR_CURRENT_XY) && defined(LULZBOT_MOTOR_CURRENT_Z) && defined(LULZBOT_MOTOR_CURRENT_E) #define LULZBOT_PWM_MOTOR_CURRENT { \ - PWM_MOTOR_CURRENT_XY, \ - PWM_MOTOR_CURRENT_Z, \ - PWM_MOTOR_CURRENT_E \ + LULZBOT_MOTOR_CURRENT_XY, \ + LULZBOT_MOTOR_CURRENT_Z, \ + LULZBOT_MOTOR_CURRENT_E \ } // Values in milliamps #elif defined(DIGIPOT_MOTOR_CURRENT_XY) && defined(DIGIPOT_MOTOR_CURRENT_Z) && defined(DIGIPOT_MOTOR_CURRENT_E) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6dcb28c1d..6c83d3cbb 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -348,14 +348,16 @@ // @section homing //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: -#define X_HOME_BUMP_MM 5 -#define Y_HOME_BUMP_MM 5 +#define X_HOME_BUMP_MM LULZBOT_X_HOME_BUMP_MM +#define Y_HOME_BUMP_MM LULZBOT_Y_HOME_BUMP_MM #define Z_HOME_BUMP_MM 2 #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) #define QUICK_HOME LULZBOT_QUICKHOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. // When G28 is called, this option will make Y home before X -//#define HOME_Y_BEFORE_X +#if defined(LULZBOT_HOME_Y_BEFORE_X) +#define HOME_Y_BEFORE_X +#endif // @section machine @@ -950,13 +952,13 @@ #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current #define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256 - #define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current. + #define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current. #define X_MICROSTEPS 16 // 0..256 - #define Y_CURRENT 1000 + #define Y_CURRENT 1000 #define Y_MICROSTEPS 16 - #define Z_CURRENT 1000 + #define Z_CURRENT 1000 #define Z_MICROSTEPS 16 //#define X2_CURRENT 1000 @@ -968,8 +970,8 @@ //#define Z2_CURRENT 1000 //#define Z2_MICROSTEPS 16 - //#define E0_CURRENT 1000 - //#define E0_MICROSTEPS 16 + #define E0_CURRENT 1000 + #define E0_MICROSTEPS 16 //#define E1_CURRENT 1000 //#define E1_MICROSTEPS 16 @@ -1042,11 +1044,13 @@ * It is advised to set X/Y_HOME_BUMP_MM to 0. * M914 X/Y to live tune the setting */ - //#define SENSORLESS_HOMING + #if defined(LULZBOT_SENSORLESS_HOMING) + #define SENSORLESS_HOMING + #endif #if ENABLED(SENSORLESS_HOMING) - #define X_HOMING_SENSITIVITY 19 - #define Y_HOMING_SENSITIVITY 19 + #define X_HOMING_SENSITIVITY 1 + #define Y_HOMING_SENSITIVITY 1 #endif /** diff --git a/Marlin/Makefile b/Marlin/Makefile index fb4356012..8f8ff40dd 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -89,6 +89,9 @@ U8GLIB ?= 1 # https://www.stix.id.au/wiki/AVR_relocation_truncations_workaround RELOC_WORKAROUND ?= 1 +# this defines whether to include the Trinamic TMC2630Stepper +TMC2630 ?= 1 + ############ # The following added by AlephObjects for adjusting the name of the output # hex file @@ -293,6 +296,10 @@ ifeq ($(U8GLIB), 1) VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/utility endif +ifeq ($(TMC2630), 1) +VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMC2130Stepper +VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMC2130Stepper/source +endif ifeq ($(HARDWARE_VARIANT), arduino) HARDWARE_SUB_VARIANT ?= mega @@ -319,7 +326,7 @@ CXXSRC = WMath.cpp WString.cpp Print.cpp Marlin_main.cpp \ temperature.cpp cardreader.cpp configuration_store.cpp \ watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \ dac_mcp4728.cpp vector_3.cpp least_squares_fit.cpp endstops.cpp stopwatch.cpp utility.cpp \ - printcounter.cpp nozzle.cpp serial.cpp gcode.cpp Max7219_Debug_LEDs.cpp + printcounter.cpp nozzle.cpp serial.cpp gcode.cpp Max7219_Debug_LEDs.cpp stepper_indirection.cpp ifeq ($(NEOPIXEL), 1) CXXSRC += Adafruit_NeoPixel.cpp endif @@ -344,6 +351,10 @@ LD_PREFIX=-nodefaultlibs LD_SUFFIX=-lm -lgcc -lc -lgcc endif +ifeq ($(TMC2630), 1) +CXXSRC += TMC2130Stepper.cpp TMC2130Stepper_CHOPCONF.cpp TMC2130Stepper_COOLCONF.cpp TMC2130Stepper_DRV_STATUS.cpp TMC2130Stepper_GCONF.cpp TMC2130Stepper_IHOLD_IRUN.cpp TMC2130Stepper_PWMCONF.cpp +endif + #Check for Arduino 1.0.0 or higher and use the correct source files for that version ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true) CXXSRC += main.cpp diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index 64e0bac51..5a8491384 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -29,8 +29,8 @@ #include "Version.h" #include "Configuration.h" #include "Conditionals_LCD.h" -#include "Configuration_adv.h" #include "pins.h" +#include "Configuration_adv.h" #ifndef USBCON #define HardwareSerial_h // trick to disable the standard HWserial #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 216395735..a2d24f014 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4014,7 +4014,6 @@ inline void gcode_G28(const bool always_home_all) { #endif #if ENABLED(HOME_Y_BEFORE_X) - // Home Y if (home_all || homeY) { HOMEAXIS(Y); diff --git a/Marlin/boards.h b/Marlin/boards.h index 398165e46..b9a8a0841 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -89,6 +89,7 @@ #define BOARD_RAMBO 301 // Rambo #define BOARD_MINIRAMBO 302 // Mini-Rambo #define BOARD_SCOOVO_X9H 303 // abee Scoovo X9H +#define BOARD_EINSYRAMBO 304 // Einsy-Rambo #define BOARD_MEGACONTROLLER 310 // Mega controller #define BOARD_ELEFU_3 21 // Elefu Ra Board (v3) #define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index dd384059f..d9a39827b 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -154,6 +154,7 @@ void Endstops::report_state() { #define ENDSTOP_HIT_TEST_Y() _ENDSTOP_HIT_TEST(Y,'Y') #define ENDSTOP_HIT_TEST_Z() _ENDSTOP_HIT_TEST(Z,'Z') + #if !defined(LULZBOT_SUPPRESS_CHATTY_ENDSTOPS) SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); ENDSTOP_HIT_TEST_X(); @@ -165,6 +166,7 @@ void Endstops::report_state() { if (TEST(endstop_hit_bits, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); #endif SERIAL_EOL(); + #endif #if ENABLED(ULTRA_LCD) lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); diff --git a/Marlin/pins.h b/Marlin/pins.h index fbf2331da..6f9df927a 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -142,6 +142,8 @@ #include "pins_RAMBO.h" // ATmega2560 #elif MB(MINIRAMBO) #include "pins_MINIRAMBO.h" // ATmega2560 +#elif MB(EINSYRAMBO) + #include "pins_EINSYRAMBO.h" // ATmega2560 #elif MB(ELEFU_3) #include "pins_ELEFU_3.h" // ATmega2560 #elif MB(LEAPFROG) diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp index 9e9d3bf99..2890af495 100644 --- a/Marlin/stepper_indirection.cpp +++ b/Marlin/stepper_indirection.cpp @@ -126,7 +126,6 @@ // TMC2130 Driver objects and inits // #if ENABLED(HAVE_TMC2130) - #include #include #include "enum.h" From 8e31248adbb1c8b225afa1defe8f4a0629038d36 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Fri, 22 Sep 2017 12:21:23 -0600 Subject: [PATCH 2/2] Added missing file. --- Marlin/pins_EINSYRAMBO.h | 171 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 Marlin/pins_EINSYRAMBO.h diff --git a/Marlin/pins_EINSYRAMBO.h b/Marlin/pins_EINSYRAMBO.h new file mode 100644 index 000000000..fd05e40ff --- /dev/null +++ b/Marlin/pins_EINSYRAMBO.h @@ -0,0 +1,171 @@ +/** + * 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 . + * + */ + +/** + * Einsy-Rambo pin assignments + */ + +#ifndef __AVR_ATmega2560__ + #error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu." +#endif + +#define BOARD_NAME "Einsy Rambo" +#define LARGE_FLASH true + +// Enable use of TMC2130 +#define HAVE_TMC2130 +#define X_IS_TMC2130 +#define Y_IS_TMC2130 +#define Z_IS_TMC2130 +#define E0_IS_TMC2130 + +#define BOARD_Z_THRES_PIN 57 // PF3 as defined in "fastio_1280.h" +#define BOARD_X_DIAG_PIN 64 // PK2 as defined in "fastio_1280.h" +#define BOARD_Y_DIAG_PIN 69 // PK7 as defined in "fastio_1280.h" +#define BOARD_Z_DIAG_PIN 68 // PK6 as defined in "fastio_1280.h" +#define BOARD_E0_DIAG_PIN 65 // PK3 as defined in "fastio_1280.h" +#define BOARD_X_MIN_PIN 12 +#define BOARD_Y_MIN_PIN 11 +#define BOARD_Z_MIN_PIN 10 + +// +// Limit Switches +// +#if defined(LULZBOT_SENSORLESS_HOMING) + #define X_MIN_PIN BOARD_X_DIAG_PIN + #define Y_MIN_PIN -1 + #define Z_MIN_PIN BOARD_Y_MIN_PIN + #define X_MAX_PIN -1 + #define Y_MAX_PIN BOARD_Y_DIAG_PIN + #define Z_MAX_PIN BOARD_X_MIN_PIN +#else + #define X_MIN_PIN BOARD_X_MIN_PIN + #define Y_MIN_PIN BOARD_Y_MIN_PIN + #define Z_MIN_PIN BOARD_Z_MIN_PIN + #define X_MAX_PIN -1 // 30 + #define Y_MAX_PIN -1 // 24 + #define Z_MAX_PIN BOARD_Z_THRES_PIN +#endif + +// +// Steppers +// +#define X_STEP_PIN 37 +#define X_DIR_PIN 49 +#define X_ENABLE_PIN 29 + +#define Y_STEP_PIN 36 +#define Y_DIR_PIN 48 +#define Y_ENABLE_PIN 28 + +#define Z_STEP_PIN 35 +#define Z_DIR_PIN 47 +#define Z_ENABLE_PIN 27 + +#define E0_STEP_PIN 34 +#define E0_DIR_PIN 43 +#define E0_ENABLE_PIN 26 + +#define E1_STEP_PIN -1 +#define E1_DIR_PIN -1 +#define E1_ENABLE_PIN -1 + +// Microstepping pins - Mapping not from fastio.h (?) +#define X_MS1_PIN -1 +#define X_MS2_PIN -1 +#define X_CS_PIN 41 +#define Y_MS1_PIN -1 +#define Y_MS2_PIN -1 +#define Y_CS_PIN 39 +#define Z_MS1_PIN -1 +#define Z_MS2_PIN -1 +#define Z_CS_PIN 67 +#define E0_MS1_PIN -1 +#define E0_MS2_PIN -1 +#define E0_CS_PIN 66 + +#define MOTOR_CURRENT_PWM_XY_PIN 46 +#define MOTOR_CURRENT_PWM_Z_PIN 45 +#define MOTOR_CURRENT_PWM_E_PIN 44 +// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range +#ifndef MOTOR_CURRENT_PWM_RANGE + #define MOTOR_CURRENT_PWM_RANGE 2000 +#endif +#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1300} + +// +// Temperature Sensors +// +#define TEMP_0_PIN 0 // Analog Input +#define TEMP_1_PIN 1 // Analog Input +#define TEMP_BED_PIN 2 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 3 +#define HEATER_1_PIN 7 +#define HEATER_2_PIN 6 +#define HEATER_BED_PIN 4 + +#define FAN_PIN 8 +#define FAN1_PIN 6 + +// +// Misc. Functions +// +//#define SDSS 53 // EINY 0-.1 - EINSY 0.3 +#define SDSS 77 // EINSY 0.4 +#define LED_PIN 13 + +// +// LCD / Controller +// +#if ENABLED(ULTRA_LCD) + + #define KILL_PIN 32 + + #if ENABLED(NEWPANEL) + + // Beeper on AUX-4 + #define BEEPER_PIN 84 + + #define LCD_PINS_RS 82 + // EINY 0.1- EINSY-0.3 + //#define LCD_PINS_ENABLE 18 + //#define LCD_PINS_D4 19 + // EINSY 0.4+ + #define LCD_PINS_ENABLE 61 + #define LCD_PINS_D4 59 + #define LCD_PINS_D5 70 + #define LCD_PINS_D6 85 + #define LCD_PINS_D7 71 + + // buttons are directly attached using AUX-2 + #define BTN_EN1 14 + #define BTN_EN2 72 + #define BTN_ENC 9 // the click + + #define SD_DETECT_PIN 15 + + #endif // NEWPANEL +#endif // ULTRA_LCD