From cc3db5899d6055a27f4bd0c56ade1b5fa21f85c8 Mon Sep 17 00:00:00 2001 From: emartinez167 Date: Sun, 5 Jul 2015 22:30:09 +0800 Subject: [PATCH] Adding support for Invent-A-Part RigidBot --- Marlin/Configuration.h | 2 + Marlin/Marlin.h | 6 ++ Marlin/Marlin_main.cpp | 25 +++++ Marlin/boards.h | 1 + Marlin/language.h | 2 + Marlin/pins.h | 2 + Marlin/pins_RIGIDBOT.h | 227 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 265 insertions(+) create mode 100644 Marlin/pins_RIGIDBOT.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 47b2b91d0c08..c50ea8998799 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -589,6 +589,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //============================================================================= // @section more +// RigidBot - Disable stepper drivers until voltage has stabilized +#define STEPPER_RESET_FIX // Custom M code points #define CUSTOM_M_CODES diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index f4e353a5d7c3..f6e0aea9f861 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -336,6 +336,12 @@ extern uint8_t active_extruder; extern void digipot_i2c_init(); #endif +// RigidBot Feature +#ifdef STEPPER_RESET_PIN + void disableStepperDrivers(void); + void enableStepperDrivers(void); +#endif + extern void calculate_volumetric_multipliers(); #endif //MARLIN_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f42f5b0a28a4..e4bee1dcc662 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -601,6 +601,12 @@ void setup() { setup_killpin(); setup_filrunoutpin(); setup_powerhold(); + + // RigidBot Feature + #ifdef STEPPER_RESET_FIX + disableStepperDrivers(); + #endif + MYSERIAL.begin(BAUDRATE); SERIAL_PROTOCOLLNPGM("start"); SERIAL_ECHO_START; @@ -656,6 +662,11 @@ void setup() { SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan #endif + // RigidBot Feature + #ifdef STEPPER_RESET_FIX + enableStepperDrivers(); + #endif + #ifdef DIGIPOT_I2C digipot_i2c_init(); #endif @@ -932,6 +943,20 @@ bool code_has_value() { return (c >= '0' && c <= '9'); } +// RigidBot Feature +#ifdef STEPPER_RESET_PIN + void disableStepperDrivers() { + pinMode(STEPPER_RESET_PIN, OUTPUT); // set to output + digitalWrite(STEPPER_RESET_PIN, LOW); // drive it down to hold in reset motor driver chips + return; + } + + void enableStepperDrivers() { + pinMode(STEPPER_RESET_PIN, INPUT); // set to input, which allows it to be pulled high by pullups + return; + } +#endif //STEPPER_RESET_PIN + float code_value() { float ret; char *e = strchr(seen_pointer, 'E'); diff --git a/Marlin/boards.h b/Marlin/boards.h index d913220c7cd6..38a0cd1ddbdf 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -16,6 +16,7 @@ #define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan) #define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 / 1.4 (Power outputs: Spindle, Controller Fan) #define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) +#define BOARD_RIGIDBOT 42 // Invent-A-Part RigidBot Electronics (Arduino Mega) #define BOARD_GEN6 5 // Gen6 #define BOARD_GEN6_DELUXE 51 // Gen6 deluxe #define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2 diff --git a/Marlin/language.h b/Marlin/language.h index 14052527003f..242ca21da24c 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -60,6 +60,8 @@ #elif MB(SAV_MKI) #define MACHINE_NAME "SAV MkI" #define SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" +#elif MB(RIGIDBOT) + #define MACHINE_NAME "RigidBot" #elif !defined(MACHINE_NAME) #define MACHINE_NAME "3D Printer" #endif diff --git a/Marlin/pins.h b/Marlin/pins.h index 0b7d34a6237b..8aa2d8a07b20 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -118,6 +118,8 @@ #include "pins_MKS_BASE.h" #elif MB(99) #include "pins_99.h" +#elif MB(RIGIDBOT) + #include "pins_RIGIDBOT.h" #else #error Unknown MOTHERBOARD value set in Configuration.h #endif diff --git a/Marlin/pins_RIGIDBOT.h b/Marlin/pins_RIGIDBOT.h new file mode 100644 index 000000000000..f782569dc289 --- /dev/null +++ b/Marlin/pins_RIGIDBOT.h @@ -0,0 +1,227 @@ +/** + * RIGIDBOT (Arduino Mega) pin assignments + */ + +#include "pins_RAMPS_13.h" + + + +#define CONTROLLERFAN_PIN 4 //Pin used for the fan to cool motherboard (-1 to disable) //Fans/Water Pump to cool the hotend cool side. +//#define EXTRUDER_0_AUTO_FAN_PIN 4 +//#define EXTRUDER_1_AUTO_FAN_PIN 5 +//#define EXTRUDER_2_AUTO_FAN_PIN -1 +//#define EXTRUDER_3_AUTO_FAN_PIN -1 + +#ifdef Z_PROBE_ENDSTOP + #define Z_PROBE_PIN 19 +#endif + +#undef HEATER_0_PIN +#undef HEATER_1_PIN +//#undef HEATER_2_PIN +//#undef HEATER_3_PIN + +#define HEATER_0_PIN 9 // EXTRUDER 1 +#define HEATER_1_PIN 12 // EXTRUDER 2 (FAN On Sprinter) +//#define HEATER_2_PIN -1 +//#define HEATER_3_PIN -1 + +#undef TEMP_0_PIN +#undef TEMP_1_PIN +//#undef TEMP_2_PIN + +#define TEMP_0_PIN 14 // ANALOG NUMBERING +#define TEMP_1_PIN 13 // ANALOG NUMBERING +//#define TEMP_2_PIN -1 // ANALOG NUMBERING + +#undef SERVO0_PIN +#undef SERVO1_PIN +#undef SERVO2_PIN +#undef SERVO3_PIN + +// +//These Servo pins are for when they are defined. Tested for usage with bed leveling +//on a Delta with 1 servo. Running through the Z servo endstop in code. +//Physical wire attachment was done on EXT1 on the GND, 5V, and D47 pins. +// +#ifdef NUM_SERVOS + #define SERVO0_PIN 11 + #if NUM_SERVOS > 1 + #define SERVO1_PIN 6 + #endif + #if NUM_SERVOS > 2 + #define SERVO2_PIN 5 + #endif + #if NUM_SERVOS > 3 + #define SERVO3_PIN 4 + #endif +#endif + + +// LCD Panel options for the RigidBoard +#undef BEEPER + +#undef LCD_PINS_RS +#undef LCD_PINS_ENABLE +#undef LCD_PINS_D4 +#undef LCD_PINS_D5 +#undef LCD_PINS_D6 +#undef LCD_PINS_D7 + +#define LCD_PINS_RS 16 +#define LCD_PINS_ENABLE 17 +#define LCD_PINS_D4 23 +#define LCD_PINS_D5 25 +#define LCD_PINS_D6 27 +#define LCD_PINS_D7 29 + +#ifdef REPRAP_DISCOUNT_SMART_CONTROLLER + #define BEEPER -1 + + #undef BTN_EN1 + #undef BTN_EN2 + #undef BTN_ENC + #define BTN_EN1 33 + #define BTN_EN2 31 + #define BTN_ENC 35 + + #undef SDCARDDETECT + #define SDCARDDETECT 22 + + #undef KILL_PIN + #define KILL_PIN 32 + +#elif defined(RIGIDPANEL) + #define BEEPER -1 + + #define BTN_UP 37 + #define BTN_DWN 35 + #define BTN_LFT 33 + #define BTN_RT 32 + + #undef BTN_EN1 + #undef BTN_EN2 + #undef BTN_ENC + #define BTN_EN1 -1 + #define BTN_EN2 -1 + #define BTN_ENC 31 + + #undef SDCARDDETECT + #define SDCARDDETECT 22 + + #undef KILL_PIN + #define KILL_PIN -1 + +#else + #define BEEPER 33 // Beeper on AUX-4 + #define KILL_PIN -1 + + //buttons are directly attached using AUX-2 + #ifdef REPRAPWORLD_KEYPAD + #define BTN_EN1 64 // encoder + #define BTN_EN2 59 // encoder + #define BTN_ENC 63 // enter button + #define SHIFT_OUT 40 // shift register + #define SHIFT_CLK 44 // shift register + #define SHIFT_LD 42 // shift register + #else + #define BTN_UP 37 + #define BTN_DWN 35 + #define BTN_LFT 33 + #define BTN_RT 32 + #define BTN_ENT 31 + //#define BTN_EN1 37 + //#define BTN_EN2 35 + //#define BTN_ENC 31 //the click + #endif + + #ifdef G3D_PANEL + #define SDCARDDETECT 49 + #else + #define SDCARDDETECT -1 // Ramps does not use this port + #endif + +#endif + + +// SPI for Max6675 Thermocouple +#ifndef SDSUPPORT + #define MAX6675_SS 53 // Do not use pin 53 if there is even the remote possibility of using Display/SD card +#else + #define MAX6675_SS 49 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present +#endif + +#ifndef SDSUPPORT + // these pins are defined in the SD library if building with SD support + #define SCK_PIN 52 + #define MISO_PIN 50 + #define MOSI_PIN 51 +#endif + + + +/**************************************************************************************** +* RigidBot Arduino Mega pin assignment +* +****************************************************************************************/ +//#define X_STEP_PIN 54 +//#define X_DIR_PIN 55 +//#define X_ENABLE_PIN 38 +//#define X_MIN_PIN 3 +//#define X_MAX_PIN 2 + +//#define Y_STEP_PIN 60 +//#define Y_DIR_PIN 61 +//#define Y_ENABLE_PIN 56 +//#define Y_MIN_PIN 14 +//#define Y_MAX_PIN 15 + +//#define Z_STEP_PIN 46 +//#define Z_DIR_PIN 48 +//#define Z_ENABLE_PIN 62 +//#define Z_MIN_PIN 18 +//#define Z_MAX_PIN 19 +//#define Z_PROBE_PIN -1 + +//#define Y2_STEP_PIN 36 // Not supported by Rigidbot +//#define Y2_DIR_PIN 34 // Not supported by Rigidbot +//#define Y2_ENABLE_PIN 30 // Not supported by Rigidbot + +//#define Z2_STEP_PIN 36 +//#define Z2_DIR_PIN 34 +//#define Z2_ENABLE_PIN 30 + +#undef E0_STEP_PIN +#undef E0_DIR_PIN +#undef E0_ENABLE_PIN + +#define E0_STEP_PIN 36 +#define E0_DIR_PIN 34 +#define E0_ENABLE_PIN 30 + +#undef E1_STEP_PIN +#undef E1_DIR_PIN +#undef E1_ENABLE_PIN + +#define E1_STEP_PIN 26 +#define E1_DIR_PIN 28 +#define E1_ENABLE_PIN 24 + +//#define SDPOWER -1 +//#define SDSS 53 +//#define LED_PIN 13 + +#undef FAN_PIN +#define FAN_PIN 8 //11 // IO pin. Buffer needed + +#undef PS_ON_PIN +#define PS_ON_PIN -1 + +#undef HEATER_BED_PIN +#define HEATER_BED_PIN 10 // BED + +#undef TEMP_BED_PIN +#define TEMP_BED_PIN 15 // ANALOG NUMBERING + + +#define STEPPER_RESET_PIN 41 // #define STEPPER_RESET_FIX in Configuration.h to use this during boot