From dd301be52dd474d7a48579c9850a08c2a0a54e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20FRANCOIS?= Date: Mon, 26 Jan 2015 18:50:29 +0100 Subject: [PATCH 1/9] Added suport for multiline G-code commands in the LCD menus --- Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 8 ++++++-- Marlin/ultralcd.cpp | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1ab316aac..0f98c69b8 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -199,7 +199,7 @@ void Stop(); bool IsStopped(); -void enquecommand(const char *cmd); //put an ASCII command at the end of the current buffer. +bool enquecommand(const char *cmd); //put an ASCII command at the end of the current buffer or return false when it is full void enquecommand_P(const char *cmd); //put an ASCII command at the end of the current buffer, read from flash void prepare_arc_move(char isclockwise); void clamp_to_software_endstops(float target[3]); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1401e7571..82325e1b3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -454,9 +454,12 @@ void serial_echopair_P(const char *s_P, unsigned long v) //adds an command to the main command buffer //thats really done in a non-safe way. //needs overworking someday -void enquecommand(const char *cmd) +//(or return false if it failed to do so) +bool enquecommand(const char *cmd) { - if(buflen < BUFSIZE) + if(buflen >= BUFSIZE) + return false; + else { //this is dangerous if a mixing of serial and this happens strcpy(&(cmdbuffer[bufindw][0]),cmd); @@ -466,6 +469,7 @@ void enquecommand(const char *cmd) SERIAL_ECHOLNPGM("\""); bufindw= (bufindw + 1)%BUFSIZE; buflen += 1; + return true; } } diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a8c7f8ca4..4297d9819 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -10,6 +10,8 @@ int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */ +const char* pgcode_seq= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */ + /* Configuration settings */ int plaPreheatHotendTemp; int plaPreheatHPBTemp; @@ -76,6 +78,7 @@ static void lcd_quick_feedback();//Cause an LCD refresh, and give the user visua static void menu_action_back(menuFunc_t data); static void menu_action_submenu(menuFunc_t data); static void menu_action_gcode(const char* pgcode); +static void menu_action_gcode_next(); static void menu_action_function(menuFunc_t data); static void menu_action_sdfile(const char* filename, char* longFilename); static void menu_action_sddirectory(const char* filename, char* longFilename); @@ -1164,7 +1167,37 @@ static void lcd_quick_feedback() /** Menu action functions **/ static void menu_action_back(menuFunc_t data) { lcd_goto_menu(data); } static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); } -static void menu_action_gcode(const char* pgcode) { enquecommand_P(pgcode); } + +static void menu_action_gcode(const char* pgcode) +{ + // No more calling enquecommand_P(pgcode) as it allows only one command! + pgcode_seq= pgcode; + menu_action_gcode_next(); +} + +static void menu_action_gcode_next() +{ + // Inject the next command from the pending sequence, when not empty. + char cmd[30]; + if(!pgcode_seq) return; + // Get the next 30 chars from the sequence of gcodes to run + strncpy_P(cmd, pgcode_seq, sizeof(cmd)-1); + cmd[sizeof(cmd)-1]= 0; + // Look for the end of line, or the end of sequence + size_t i= 0; + char c; + while( (c= cmd[i]) && c!='\n' ) + ++i; // look for the end of this gcode command + cmd[i]= 0; + if(!enquecommand(cmd)) // buffer was full, will retry later + return; + if(c) + pgcode_seq+= i+1; // move to next command + else + pgcode_seq= NULL; // mark the end of the sequence of gcodes +} + + static void menu_action_function(menuFunc_t data) { (*data)(); } static void menu_action_sdfile(const char* filename, char* longFilename) { @@ -1257,6 +1290,8 @@ void lcd_update() lcd_buttons_update(); + menu_action_gcode_next(); // inject the next pending command in the pending sequence (if any) + #if (SDCARDDETECT > 0) if((IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected())) { From 85e5aa4011cf65c0b09a4453bd1f3ac3752ba072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20FRANCOIS?= Date: Sat, 7 Feb 2015 23:24:20 +0100 Subject: [PATCH 2/9] Generalized enqueue_commands_P, and moved them to Marlin_main as they should --- Marlin/Configuration.h | 314 ++++++++---------- Marlin/Configuration_adv.h | 4 +- Marlin/Marlin.h | 5 +- Marlin/Marlin.pde | 56 ---- Marlin/Marlin_main.cpp | 84 +++-- Marlin/cardreader.cpp | 4 +- .../delta/Configuration.h | 2 - Marlin/ultralcd.cpp | 48 +-- 8 files changed, 220 insertions(+), 297 deletions(-) delete mode 100644 Marlin/Marlin.pde diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4e0786199..87cb10bd1 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -14,12 +14,6 @@ // example_configurations/delta directory. // -//=========================================================================== -//============================= SCARA Printer =============================== -//=========================================================================== -// For a Delta printer replace the configuration files with the files in the -// example_configurations/SCARA directory. -// // 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 @@ -27,7 +21,7 @@ #define STRING_VERSION "v1.0.2" #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time -#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +#define STRING_CONFIG_H_AUTHOR "(Jeremie, Tridimake)" // JFR - Who made the changes. #define STRING_SPLASH STRING_VERSION " - " STRING_URL // will be shown during bootup // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -36,7 +30,8 @@ #define SERIAL_PORT 0 // This determines the communication speed of the printer -#define BAUDRATE 250000 +//#define BAUDRATE 250000 +#define BAUDRATE 115200 // This enables the serial port associated to the Bluetooth interface //#define BTENABLED // Enable BT interface on AT90USB devices @@ -44,11 +39,11 @@ // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_ULTIMAKER + #define MOTHERBOARD 33 // JFR - was BOARD_ULTIMAKER #endif // Define this to set a custom name for your generic Mendel, -// #define CUSTOM_MENDEL_NAME "This Mendel" +#define CUSTOM_MENDEL_NAME "[RMud]HP" // JFR -was "This Mendel" // 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) @@ -66,6 +61,50 @@ // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. // #define PS_DEFAULT_OFF +//=========================================================================== +//============================== Delta Settings ============================= +//=========================================================================== +// Enable DELTA kinematics and most of the default configuration for Deltas +#define DELTA + +// Make delta curves from many straight lines (linear interpolation). +// This is a trade-off between visible corners (not enough segments) +// and processor overload (too many expensive sqrt calls). +#define DELTA_SEGMENTS_PER_SECOND 100 // JFR: was 200 + +/* + Parameter essential for delta calibration: + + C, Y-Axis + | |___| CARRIAGE_HORIZONTAL_OFFSET + | | \ + |_________ X-axis | \ + / \ | \ DELTA_DIAGONAL_ROD + / \ \ + / \ \ Carriage is at printer center! + A B \_____/ + |--| END_EFFECTOR_HORIZONTAL_OFFSET + |----| DELTA_RADIUS + |-----------| PRINTER_RADIUS + + Column angles are measured from X-axis counterclockwise +*/ + +// Center-to-center distance of the holes in the diagonal push rods. +#define DELTA_DIAGONAL_ROD (202.4) // mm JFR: was 202 for LABSUD + +// Horizontal offset from middle of printer to smooth rod center. +#define DELTA_SMOOTH_ROD_OFFSET 139.5 // mm + +// Horizontal offset of the universal joints on the end effector. +#define DELTA_EFFECTOR_OFFSET 18.0 // mm + +// Horizontal offset of the universal joints on the carriages. +#define DELTA_CARRIAGE_OFFSET 18.0 // mm + +// Effective horizontal distance bridged by diagonal push rods. +#define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET) + //=========================================================================== //=============================Thermal Settings ============================ //=========================================================================== @@ -104,8 +143,8 @@ // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) -#define TEMP_SENSOR_0 -1 -#define TEMP_SENSOR_1 -1 +#define TEMP_SENSOR_0 1 // JFR -was -1 +#define TEMP_SENSOR_1 0 // JFR -was -1 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_BED 0 @@ -114,7 +153,7 @@ #define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 // Actual temperature must be close to target for this long before M109 returns success -#define TEMP_RESIDENCY_TIME 10 // (seconds) +#define TEMP_RESIDENCY_TIME 4 // // JFR -was 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. @@ -146,25 +185,23 @@ // PID settings: // 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 BANG_MAX 80 // JFR -was 255 // limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX 70 // JFR -was BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #ifdef PIDTEMP //#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_EXTRUDER // 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 then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine +// JFR: was #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine + #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker - #define DEFAULT_Kp 22.2 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114 +// #define DEFAULT_Kp 22.2 +// #define DEFAULT_Ki 1.08 +// #define DEFAULT_Kd 114 // MakerGear // #define DEFAULT_Kp 7.0 @@ -175,6 +212,12 @@ // #define DEFAULT_Kp 63.0 // #define DEFAULT_Ki 2.25 // #define DEFAULT_Kd 440 + +// E3D 24v calibrée par frafa avec buse 12v30W alimentée en 24v + #define DEFAULT_Kp 12.48 + #define DEFAULT_Ki 1.63 + #define DEFAULT_Kd 23.93 + #endif // PIDTEMP // Bed Temperature Control @@ -217,7 +260,7 @@ //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit //can be software-disabled for whatever purposes by -#define PREVENT_DANGEROUS_EXTRUDE +//#define PREVENT_DANGEROUS_EXTRUDE // JFR - was enabled //if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately. #define PREVENT_LENGTHY_EXTRUDE @@ -266,9 +309,6 @@ your extruder heater takes 2 minutes to hit the target on heating. //=============================Mechanical Settings=========================== //=========================================================================== -// Uncomment the following line to enable CoreXY kinematics -// #define COREXY - // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -295,12 +335,12 @@ your extruder heater takes 2 minutes to hit the target on heating. const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool X_MAX_ENDSTOP_INVERTING = false; // JFR -was true // set to true to invert the logic of the endstop. +const bool Y_MAX_ENDSTOP_INVERTING = false; // JFR -was true // set to true to invert the logic of the endstop. +const bool Z_MAX_ENDSTOP_INVERTING = false; // JFR -was true // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS - +// Deltas never have min endstops +//#define DISABLE_MIN_ENDSTOPS // JFR- was not commented out! // Disable max endstops for compatibility with endstop checking routine #if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS) #define DISABLE_MAX_ENDSTOPS @@ -319,149 +359,39 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_X_DIR false // DELTA does not invert +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false + +#define INVERT_E0_DIR true // JFR - was false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN -#define X_HOME_DIR -1 -#define Y_HOME_DIR -1 -#define Z_HOME_DIR -1 +// deltas always home to max +#define X_HOME_DIR 1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 #define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing -#define X_MAX_POS 205 -#define X_MIN_POS 0 -#define Y_MAX_POS 205 -#define Y_MIN_POS 0 -#define Z_MAX_POS 200 +#define X_MAX_POS 85 // JFR - was 205 +#define X_MIN_POS -85 // JFR - was 0 +#define Y_MAX_POS 85 // JFR - was 205 +#define Y_MIN_POS -85 // JFR - was 0 +#define Z_MAX_POS MANUAL_Z_HOME_POS // JFR - was 200 #define Z_MIN_POS 0 #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS) #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS) #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS) //============================= Bed Auto Leveling =========================== - -//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) -#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - -#ifdef ENABLE_AUTO_BED_LEVELING - -// There are 2 different ways to pick the X and Y locations to probe: - -// - "grid" mode -// Probe every point in a rectangular grid -// You must specify the rectangle, and the density of sample points -// This mode is preferred because there are more measurements. -// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive - -// - "3-point" mode -// Probe 3 arbitrary points on the bed (that aren't colinear) -// You must specify the X & Y coordinates of all 3 points - - #define AUTO_BED_LEVELING_GRID - // with AUTO_BED_LEVELING_GRID, the bed is sampled in a - // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid - // and least squares solution is calculated - // Note: this feature occupies 10'206 byte - #ifdef AUTO_BED_LEVELING_GRID - - // set the rectangle in which to probe - #define LEFT_PROBE_BED_POSITION 15 - #define RIGHT_PROBE_BED_POSITION 170 - #define BACK_PROBE_BED_POSITION 180 - #define FRONT_PROBE_BED_POSITION 20 - - // set the number of grid points per dimension - // I wouldn't see a reason to go above 3 (=9 probing points on the bed) - #define AUTO_BED_LEVELING_GRID_POINTS 2 +//Bed Auto Leveling is still not compatible with Delta Kinematics - #else // not AUTO_BED_LEVELING_GRID - // with no grid, just probe 3 arbitrary points. A simple cross-product - // is used to esimate the plane of the print bed - - #define ABL_PROBE_PT_1_X 15 - #define ABL_PROBE_PT_1_Y 180 - #define ABL_PROBE_PT_2_X 15 - #define ABL_PROBE_PT_2_Y 20 - #define ABL_PROBE_PT_3_X 170 - #define ABL_PROBE_PT_3_Y 20 - - #endif // AUTO_BED_LEVELING_GRID - - - // these are the offsets to the probe relative to the extruder tip (Hotend - Probe) - // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 - - #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. - // Be sure you have this distance over your Z_MAX_POS in case - - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min - - #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. - #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points - - //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell - //#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. - - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - -//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, -//it is highly recommended you let this Z_SAFE_HOMING enabled!!! - - #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area. - // When defined, it will: - // - Allow Z homing only after X and Y homing AND stepper drivers still enabled - // - If stepper drivers timeout, it will need X and Y homing again before Z homing - // - Position the probe in a defined XY point before Z Homing when homing all axis (G28) - // - Block Z homing only when the probe is outside bed area. - - #ifdef Z_SAFE_HOMING - - #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) - #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) - - #endif - - #ifdef AUTO_BED_LEVELING_GRID // Check if Probe_Offset * Grid Points is greater than Probing Range - #if X_PROBE_OFFSET_FROM_EXTRUDER < 0 - #if (-(X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION)) - #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" - #endif - #else - #if ((X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION)) - #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" - #endif - #endif - #if Y_PROBE_OFFSET_FROM_EXTRUDER < 0 - #if (-(Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION)) - #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" - #endif - #else - #if ((Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION)) - #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" - #endif - #endif - - - #endif - -#endif // ENABLE_AUTO_BED_LEVELING // The position of the homing switches @@ -469,24 +399,62 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) //Manual homing switch locations: + +#define MANUAL_HOME_POSITIONS // MANUAL_*_HOME_POS below will be used // JFR- was disabled // For deltabots this means top and center of the Cartesian print volume. #define MANUAL_X_HOME_POS 0 #define MANUAL_Y_HOME_POS 0 -#define MANUAL_Z_HOME_POS 0 +#define MANUAL_Z_HOME_POS (142.7-1) //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) + +// delta homing speeds must be the same on xyz +#define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0} // set the homing speeds (mm/min) + +// ================>>>>> N.R. with bug fixes by JFR +// Compute speed, feedrate and acceleration by means of pulley & motor specs only // default settings +#define PI 3.14159265 +#define G 9806.65 -#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200.0*8/3,760*1.1} // default steps per unit for Ultimaker -#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 25} // (mm/sec) -#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. +//Motors (movement) +#define MVT_N 3 // g acceleration for movement (3 ok) +#define MVT_SPR 200.0 // step per revolution +#define MVT_MS 32 // microstep (1/32 only possible with DRV8825 -- also 2.5A) +#define MVT_OMEG 900.0 // maximum number of revolutions per minute at 19V (was 600-900) +#define PULLEY_TN 26.0 // number of teeth on X/Y/Z pulley +#define PULLEY_STEP 3.0 // pulley tooth size (mm) + +//Extruder motor +#define XTR_N MVT_N // g acceleration for extruder +#define XTR_SPR (MVT_SPR*5) // step per revolution (with 5:1 reductor) +#define XTR_MS MVT_MS // microstep +#define XTR_OMEG 225.0 // maximum number of revolutions per minute // was 600-900 +#define MVT_DHB 10.56 // Hobbed bolt diameter + +#define MVT_PCIRC ( PULLEY_TN * PULLEY_STEP ) // pulley circumference +#define MVT_S ( MVT_SPR * MVT_MS / MVT_PCIRC ) // step_per_revolution * microstepping / circumference +#define MVT_V ( MVT_OMEG * MVT_PCIRC / 60.0 ) // max velocity (mm/s) + +#define XTR_HBCIRC ( PI * MVT_DHB ) // hobbed bolt circumference from diameter +#define XTR_S ( XTR_SPR * XTR_MS / XTR_HBCIRC ) //step per mm +#define XTR_V ( XTR_OMEG * XTR_HBCIRC / 60 ) // max velocity (mm/s) + +// the second axis sometimes needs /2 (BROKEN DRIVER??!!) +#define DEFAULT_AXIS_STEPS_PER_UNIT { MVT_S, MVT_S, MVT_S, XTR_S } +#define DEFAULT_MAX_FEEDRATE { MVT_V, MVT_V, MVT_V, XTR_V } // (mm/sec) +//JFR: is this OK?? #define DEFAULT_MAX_ACCELERATION { MVT_N*G, MVT_N*G, MVT_N*G, XTR_N*G } // X, Y, Z, E maximum start speed for accelerated moves. +#define DEFAULT_MAX_ACCELERATION {9000,9000,9000,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot. + +// JFR: do we want to multiply here by MVT_N and XTR_N ipo N ? +#define DEFAULT_ACCELERATION (MVT_N*G*3/4) // X, Y, Z and E max acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION (XTR_N*G*3/4) // X, Y, Z and E max acceleration in mm/s^2 for r retracts + +//<<<<<================ JFR / N.R. -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). @@ -496,7 +464,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) #define DEFAULT_XYJERK 20.0 // (mm/sec) -#define DEFAULT_ZJERK 0.4 // (mm/sec) +#define DEFAULT_ZJERK 20.0 // (mm/sec) Must be same as XY for delta #define DEFAULT_EJERK 5.0 // (mm/sec) //=========================================================================== @@ -521,7 +489,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define EEPROM_SETTINGS //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: // please keep turned on if you can. -//#define EEPROM_CHITCHAT +#define EEPROM_CHITCHAT // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 @@ -551,7 +519,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller -//#define REPRAP_DISCOUNT_SMART_CONTROLLER +#define REPRAP_DISCOUNT_SMART_CONTROLLER // The GADGETS3D G3D LCD/SD Controller (blue PCB) // http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel @@ -573,6 +541,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C //#define RA_CONTROL_PANEL +// Delta calibration menu +// uncomment to add three points calibration menu option. +// See http://minow.blogspot.com/index.html#4918805519571907051 +// If needed, adjust the X, Y, Z calibration coordinates +// in ultralcd.cpp@lcd_delta_calibrate_menu() +#define DELTA_CALIBRATION_MENU // JFR - was disabled + //automatic expansion #if defined (MAKRPANEL) #define DOGLCD @@ -771,13 +746,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Uncomment below to enable //#define FILAMENT_SENSOR -#define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) -#define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel +#define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) +#define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel #define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm -#define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) +#define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) //defines used in the code #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially @@ -790,6 +765,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + #include "Configuration_adv.h" #include "thermistortables.h" diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a503e640f..72f8aac57 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -213,7 +213,7 @@ //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 2 +#define Z_HOME_RETRACT_MM 5 //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -248,7 +248,7 @@ #define DEFAULT_MINSEGMENTTIME 20000 // If defined the movements slow down when the look ahead buffer is only half full -#define SLOWDOWN +// #define SLOWDOWN // JFR - important, was enabled!! // Frequency limit // See nophead's blog for more info diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 0f98c69b8..fc85e7f3a 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -199,8 +199,9 @@ void Stop(); bool IsStopped(); -bool enquecommand(const char *cmd); //put an ASCII command at the end of the current buffer or return false when it is full -void enquecommand_P(const char *cmd); //put an ASCII command at the end of the current buffer, read from flash +bool enquecommand(const char *cmd); //put a single ASCII command at the end of the current buffer or return false when it is full +void enquecommands_P(const char *cmd); //put one or many ASCII commands at the end of the current buffer, read from flash + void prepare_arc_move(char isclockwise); void clamp_to_software_endstops(float target[3]); diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde deleted file mode 100644 index 79c934bf0..000000000 --- a/Marlin/Marlin.pde +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ - -/* - Reprap firmware 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 firmware is a mashup between Sprinter and grbl. - (https://github.com/kliment/Sprinter) - (https://github.com/simen/grbl/tree) - - It has preliminary support for Matthew Roberts advance algorithm - http://reprap.org/pipermail/reprap-dev/2011-May/003323.html - */ - -/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */ -/* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */ - -#include "Configuration.h" -#include "pins.h" - -#ifdef ULTRA_LCD - #if defined(LCD_I2C_TYPE_PCF8575) - #include - #include - #elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008) - #include - #include - #elif defined(DOGLCD) - #include // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/) - #else - #include // library for character LCD - #endif -#endif - -#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1 -#include -#endif - -#if defined(DIGIPOT_I2C) - #include -#endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 82325e1b3..e18d08c0d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -384,6 +384,8 @@ static int serial_count = 0; static boolean comment_mode = false; static char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc +const char* queued_commands_P= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */ + const int sensitive_pins[] = SENSITIVE_PINS; // Sensitive pin list for M42 //static float tt = 0; @@ -451,43 +453,64 @@ void serial_echopair_P(const char *s_P, unsigned long v) } #endif //!SDSUPPORT -//adds an command to the main command buffer -//thats really done in a non-safe way. -//needs overworking someday -//(or return false if it failed to do so) -bool enquecommand(const char *cmd) +//Injects the next command from the pending sequence of commands, when possible +//Return false if and only if no command was pending +static bool drain_queued_commands_P() { - if(buflen >= BUFSIZE) + char cmd[30]; + if(!queued_commands_P) return false; - else + // Get the next 30 chars from the sequence of gcodes to run + strncpy_P(cmd, queued_commands_P, sizeof(cmd)-1); + cmd[sizeof(cmd)-1]= 0; + // Look for the end of line, or the end of sequence + size_t i= 0; + char c; + while( (c= cmd[i]) && c!='\n' ) + ++i; // look for the end of this gcode command + cmd[i]= 0; + if(enquecommand(cmd)) // buffer was not full (else we will retry later) { - //this is dangerous if a mixing of serial and this happens - strcpy(&(cmdbuffer[bufindw][0]),cmd); - SERIAL_ECHO_START; - SERIAL_ECHOPGM(MSG_Enqueing); - SERIAL_ECHO(cmdbuffer[bufindw]); - SERIAL_ECHOLNPGM("\""); - bufindw= (bufindw + 1)%BUFSIZE; - buflen += 1; - return true; + if(c) + queued_commands_P+= i+1; // move to next command + else + queued_commands_P= NULL; // will have no more commands in the sequence } + return true; } -void enquecommand_P(const char *cmd) +//Record one or many commands to run from program memory. +//Aborts the current queue, if any. +//Note: drain_queued_commands_P() must be called repeatedly to drain the commands afterwards +void enquecommands_P(const char* pgcode) { - if(buflen < BUFSIZE) - { - //this is dangerous if a mixing of serial and this happens - strcpy_P(&(cmdbuffer[bufindw][0]),cmd); - SERIAL_ECHO_START; - SERIAL_ECHOPGM(MSG_Enqueing); - SERIAL_ECHO(cmdbuffer[bufindw]); - SERIAL_ECHOLNPGM("\""); - bufindw= (bufindw + 1)%BUFSIZE; - buflen += 1; - } + queued_commands_P= pgcode; + drain_queued_commands_P(); // first command exectuted asap (when possible) } +//adds a single command to the main command buffer, from RAM +//that is really done in a non-safe way. +//needs overworking someday +//Returns false if it failed to do so +bool enquecommand(const char *cmd) +{ + if(*cmd==';') + return false; + if(buflen >= BUFSIZE) + return false; + //this is dangerous if a mixing of serial and this happens + strcpy(&(cmdbuffer[bufindw][0]),cmd); + SERIAL_ECHO_START; + SERIAL_ECHOPGM(MSG_Enqueing); + SERIAL_ECHO(cmdbuffer[bufindw]); + SERIAL_ECHOLNPGM("\""); + bufindw= (bufindw + 1)%BUFSIZE; + buflen += 1; + return true; +} + + + void setup_killpin() { #if defined(KILL_PIN) && KILL_PIN > -1 @@ -691,6 +714,9 @@ void loop() void get_command() { + if(drain_queued_commands_P()) // priority is given to non-serial commands + return; + while( MYSERIAL.available() > 0 && buflen < BUFSIZE) { serial_char = MYSERIAL.read(); if(serial_char == '\n' || @@ -4489,7 +4515,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s { if (homeDebounceCount == 0) { - enquecommand_P((PSTR("G28"))); + enquecommands_P((PSTR("G28"))); homeDebounceCount++; LCD_ALERTMESSAGEPGM(MSG_AUTO_HOME); } diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index e22f3436b..33fe819bd 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -532,7 +532,7 @@ void CardReader::checkautostart(bool force) sprintf_P(cmd, PSTR("M23 %s"), autoname); enquecommand(cmd); - enquecommand_P(PSTR("M24")); + enquecommands_P(PSTR("M24")); found=true; } } @@ -637,7 +637,7 @@ void CardReader::printingHasFinished() if(SD_FINISHED_STEPPERRELEASE) { //finishAndDisableSteppers(); - enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); } autotempShutdown(); } diff --git a/Marlin/example_configurations/delta/Configuration.h b/Marlin/example_configurations/delta/Configuration.h index 6c530e923..e2689e5c3 100644 --- a/Marlin/example_configurations/delta/Configuration.h +++ b/Marlin/example_configurations/delta/Configuration.h @@ -67,8 +67,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 200 -// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them - // Center-to-center distance of the holes in the diagonal push rods. #define DELTA_DIAGONAL_ROD 250.0 // mm diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4297d9819..3ea0f461f 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -10,8 +10,6 @@ int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */ -const char* pgcode_seq= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */ - /* Configuration settings */ int plaPreheatHotendTemp; int plaPreheatHPBTemp; @@ -78,7 +76,6 @@ static void lcd_quick_feedback();//Cause an LCD refresh, and give the user visua static void menu_action_back(menuFunc_t data); static void menu_action_submenu(menuFunc_t data); static void menu_action_gcode(const char* pgcode); -static void menu_action_gcode_next(); static void menu_action_function(menuFunc_t data); static void menu_action_sdfile(const char* filename, char* longFilename); static void menu_action_sddirectory(const char* filename, char* longFilename); @@ -327,7 +324,7 @@ static void lcd_sdcard_stop() quickStop(); if(SD_FINISHED_STEPPERRELEASE) { - enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); } autotempShutdown(); @@ -350,6 +347,7 @@ static void lcd_main_menu() MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); #endif // DELTA_CALIBRATION_MENU } +/*JFR TEST*/ MENU_ITEM(gcode, "test multiline", PSTR("G4 S3\nM104 S50\nG4 S1\nM104 S200\nG4 S2\nM104 S0")); // SD-card changed by user MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); #ifdef SDSUPPORT if (card.cardOK) @@ -397,8 +395,7 @@ void lcd_set_home_offsets() plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]); // Audio feedback - enquecommand_P(PSTR("M300 S659 P200")); - enquecommand_P(PSTR("M300 S698 P200")); + enquecommands_P(PSTR("M300 S659 P200\nM300 S698 P200")); lcd_return_to_status(); } @@ -680,6 +677,13 @@ static void lcd_prepare_menu() } #endif MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); + + // JFR for RMud delta printer + MENU_ITEM(gcode, "Calibrate bed", PSTR("M702\nG28\nG1 X-77.94 Y-45 Z36 F8000\nG4 S3\nM701 P0\nG1 X77.94 Y-45 Z36\nG4 S3\nM701 P1\nG1 X0 Y90 Z36\nG4 S3\nM701 P2\nM700\nG1 X0 Y0 Z100 F8000")); + MENU_ITEM(gcode, "Check level", PSTR("G28\nG1 X0 Y0 Z1 F4000\nG1 X-77.94 Y-45 Z1\nG1 X77.94 Y-45\nG1 X0 Y90\nG1 X-77.94 Y-45\nG4 S2\nG1 X-77.94 Y-45 Z0.3 F2000\nG1 X-77.94 Y-45\nG1 X77.94 Y-45\nG1 X0 Y90\nG1 X-77.94 Y-45\nG1 X0 Y0 Z0")); + MENU_ITEM(gcode, "Retract filament", PSTR("M302\nM82\nG92 E0\nG1 F4000 E-800")); + MENU_ITEM(gcode, "Insert filament", PSTR("M302\nM82\nG92 E0\nG1 F4000 E60")); + MENU_ITEM(gcode, "Finalize filament", PSTR("G1 F4000 E790")); END_MENU(); } @@ -1151,7 +1155,7 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01) lcd_move_y(); } static void reprapworld_keypad_move_home() { - enquecommand_P((PSTR("G28"))); // move all axis home + enquecommands_P((PSTR("G28"))); // move all axis home } #endif @@ -1170,31 +1174,7 @@ static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); } static void menu_action_gcode(const char* pgcode) { - // No more calling enquecommand_P(pgcode) as it allows only one command! - pgcode_seq= pgcode; - menu_action_gcode_next(); -} - -static void menu_action_gcode_next() -{ - // Inject the next command from the pending sequence, when not empty. - char cmd[30]; - if(!pgcode_seq) return; - // Get the next 30 chars from the sequence of gcodes to run - strncpy_P(cmd, pgcode_seq, sizeof(cmd)-1); - cmd[sizeof(cmd)-1]= 0; - // Look for the end of line, or the end of sequence - size_t i= 0; - char c; - while( (c= cmd[i]) && c!='\n' ) - ++i; // look for the end of this gcode command - cmd[i]= 0; - if(!enquecommand(cmd)) // buffer was full, will retry later - return; - if(c) - pgcode_seq+= i+1; // move to next command - else - pgcode_seq= NULL; // mark the end of the sequence of gcodes + enquecommands_P(pgcode); } @@ -1207,7 +1187,7 @@ static void menu_action_sdfile(const char* filename, char* longFilename) for(c = &cmd[4]; *c; c++) *c = tolower(*c); enquecommand(cmd); - enquecommand_P(PSTR("M24")); + enquecommands_P(PSTR("M24")); lcd_return_to_status(); } static void menu_action_sddirectory(const char* filename, char* longFilename) @@ -1290,8 +1270,6 @@ void lcd_update() lcd_buttons_update(); - menu_action_gcode_next(); // inject the next pending command in the pending sequence (if any) - #if (SDCARDDETECT > 0) if((IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected())) { From 697ee2dc502eb9e9dda8600a57ed21d7db621547 Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 8 Feb 2015 01:05:05 -0700 Subject: [PATCH 3/9] Compiling errors with 4 Extruders defined Here were a few changes that I had to make/add lines for the 4th hotend. A compiling problem in the Temperature.cpp and missing lines in configuration.h and configuration_adv.h. I added these lines in all of the example configs too. --- Marlin/Configuration.h | 3 +++ .../example_configurations/Hephestos/Configuration.h | 5 ++++- Marlin/example_configurations/K8200/Configuration.h | 5 ++++- Marlin/example_configurations/SCARA/Configuration.h | 5 ++++- .../example_configurations/SCARA/Configuration_adv.h | 12 ++++++++++++ Marlin/example_configurations/WITBOX/Configuration.h | 5 ++++- Marlin/example_configurations/delta/Configuration.h | 5 ++++- .../example_configurations/delta/Configuration_adv.h | 12 ++++++++++++ .../example_configurations/makibox/Configuration.h | 5 ++++- .../makibox/Configuration_adv.h | 12 ++++++++++++ .../tvrrug/Round2/Configuration.h | 5 ++++- .../tvrrug/Round2/Configuration_adv.h | 12 ++++++++++++ Marlin/temperature.cpp | 3 +-- 13 files changed, 80 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 770c86eb1..ea4bf9600 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -122,6 +122,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 0 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -139,6 +140,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -147,6 +149,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 2823f2d95..c5554546e 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -122,6 +122,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 0 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -139,6 +140,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -147,6 +149,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 260 #define HEATER_1_MAXTEMP 260 #define HEATER_2_MAXTEMP 260 +#define HEATER_3_MAXTEMP 260 #define BED_MAXTEMP 150 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 06e944b19..eb53407ff 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -124,6 +124,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 5 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -141,6 +142,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -149,6 +151,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 8bc4eb70e..9a165a3c6 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -142,6 +142,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 1 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -159,6 +160,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -167,6 +169,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 8c65ad26c..40d4fc2e9 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -78,6 +78,7 @@ #define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -478,6 +479,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define THERMISTORHEATER_2 TEMP_SENSOR_2 #define HEATER_2_USES_THERMISTOR #endif +#if TEMP_SENSOR_3 > 0 + #define THERMISTORHEATER_3 TEMP_SENSOR_3 + #define HEATER_3_USES_THERMISTOR +#endif #if TEMP_SENSOR_BED > 0 #define THERMISTORBED TEMP_SENSOR_BED #define BED_USES_THERMISTOR @@ -491,6 +496,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #if TEMP_SENSOR_2 == -1 #define HEATER_2_USES_AD595 #endif +#if TEMP_SENSOR_3 == -1 + #define HEATER_3_USES_AD595 +#endif #if TEMP_SENSOR_BED == -1 #define BED_USES_AD595 #endif @@ -509,6 +517,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #undef HEATER_2_MINTEMP #undef HEATER_2_MAXTEMP #endif +#if TEMP_SENSOR_3 == 0 + #undef HEATER_3_MINTEMP + #undef HEATER_3_MAXTEMP +#endif #if TEMP_SENSOR_BED == 0 #undef BED_MINTEMP #undef BED_MAXTEMP diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 4a12bda51..26302076b 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -125,6 +125,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 0 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -142,6 +143,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -150,6 +152,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 260 #define HEATER_1_MAXTEMP 260 #define HEATER_2_MAXTEMP 260 +#define HEATER_3_MAXTEMP 260 #define BED_MAXTEMP 150 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the diff --git a/Marlin/example_configurations/delta/Configuration.h b/Marlin/example_configurations/delta/Configuration.h index 3eb268041..d3a6f7fcc 100644 --- a/Marlin/example_configurations/delta/Configuration.h +++ b/Marlin/example_configurations/delta/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -147,6 +147,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 0 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -164,6 +165,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -172,6 +174,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the diff --git a/Marlin/example_configurations/delta/Configuration_adv.h b/Marlin/example_configurations/delta/Configuration_adv.h index 7150c2c88..73264982b 100644 --- a/Marlin/example_configurations/delta/Configuration_adv.h +++ b/Marlin/example_configurations/delta/Configuration_adv.h @@ -78,6 +78,7 @@ #define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -472,6 +473,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define THERMISTORHEATER_2 TEMP_SENSOR_2 #define HEATER_2_USES_THERMISTOR #endif +#if TEMP_SENSOR_3 > 0 + #define THERMISTORHEATER_3 TEMP_SENSOR_3 + #define HEATER_3_USES_THERMISTOR +#endif #if TEMP_SENSOR_BED > 0 #define THERMISTORBED TEMP_SENSOR_BED #define BED_USES_THERMISTOR @@ -485,6 +490,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #if TEMP_SENSOR_2 == -1 #define HEATER_2_USES_AD595 #endif +#if TEMP_SENSOR_3 == -1 + #define HEATER_3_USES_AD595 +#endif #if TEMP_SENSOR_BED == -1 #define BED_USES_AD595 #endif @@ -503,6 +511,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #undef HEATER_2_MINTEMP #undef HEATER_2_MAXTEMP #endif +#if TEMP_SENSOR_3 == 0 + #undef HEATER_3_MINTEMP + #undef HEATER_3_MAXTEMP +#endif #if TEMP_SENSOR_BED == 0 #undef BED_MINTEMP #undef BED_MAXTEMP diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 99feceba8..be3b0f69d 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -127,6 +127,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 12 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -144,6 +145,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -152,6 +154,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index bf646f0f4..bcdb09ef4 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -78,6 +78,7 @@ #define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -469,6 +470,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define THERMISTORHEATER_2 TEMP_SENSOR_2 #define HEATER_2_USES_THERMISTOR #endif +#if TEMP_SENSOR_3 > 0 + #define THERMISTORHEATER_3 TEMP_SENSOR_3 + #define HEATER_3_USES_THERMISTOR +#endif #if TEMP_SENSOR_BED > 0 #define THERMISTORBED TEMP_SENSOR_BED #define BED_USES_THERMISTOR @@ -482,6 +487,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #if TEMP_SENSOR_2 == -1 #define HEATER_2_USES_AD595 #endif +#if TEMP_SENSOR_3 == -1 + #define HEATER_3_USES_AD595 +#endif #if TEMP_SENSOR_BED == -1 #define BED_USES_AD595 #endif @@ -500,6 +508,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #undef HEATER_2_MINTEMP #undef HEATER_2_MAXTEMP #endif +#if TEMP_SENSOR_3 == 0 + #undef HEATER_3_MINTEMP + #undef HEATER_3_MAXTEMP +#endif #if TEMP_SENSOR_BED == 0 #undef BED_MINTEMP #undef BED_MAXTEMP diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4ca415d8f..4c01596ce 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" @@ -126,6 +126,7 @@ Here are some standard links for getting your machine calibrated: #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 5 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. @@ -143,6 +144,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -151,6 +153,7 @@ Here are some standard links for getting your machine calibrated: #define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 #define CONFIG_STEPPERS_TOSHIBA 1 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 6f1bf7322..46c0a9ba5 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -78,6 +78,7 @@ #define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -472,6 +473,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define THERMISTORHEATER_2 TEMP_SENSOR_2 #define HEATER_2_USES_THERMISTOR #endif +#if TEMP_SENSOR_3 > 0 + #define THERMISTORHEATER_3 TEMP_SENSOR_3 + #define HEATER_3_USES_THERMISTOR +#endif #if TEMP_SENSOR_BED > 0 #define THERMISTORBED TEMP_SENSOR_BED #define BED_USES_THERMISTOR @@ -485,6 +490,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #if TEMP_SENSOR_2 == -1 #define HEATER_2_USES_AD595 #endif +#if TEMP_SENSOR_3 == -1 + #define HEATER_3_USES_AD595 +#endif #if TEMP_SENSOR_BED == -1 #define BED_USES_AD595 #endif @@ -503,6 +511,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #undef HEATER_2_MINTEMP #undef HEATER_2_MAXTEMP #endif +#if TEMP_SENSOR_3 == 0 + #undef HEATER_3_MINTEMP + #undef HEATER_3_MAXTEMP +#endif #if TEMP_SENSOR_BED == 0 #undef BED_MINTEMP #undef BED_MAXTEMP diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 9889e1fda..b04ea4d96 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -465,8 +465,7 @@ void checkExtruderAutoFans() #endif #if defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN > -1 if (EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN - && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN) - && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) + && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_2_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_3_AUTO_FAN_PIN, (fanState & 8) != 0); #endif } From 38a500d05cf033a549c3e2b1b5c7fe32f92a9c48 Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 8 Feb 2015 03:14:59 -0700 Subject: [PATCH 4/9] Viki 2 Implementation I've insert the define and pointer entries for the Viki 2 and miniViki from Panucatt in all of the example configs and main config. With these additions and with pins done in the old single pin.h style...I was able to get the display working fine save for needing to turn Delta Segments per Second down. But that's a common graphics lcd issue being looked into right now. I need assistance in understanding how the new divided pins files fit together because my previous attempts at trying to get it to work appropriately didn't seem successful. This originally came from trying to find out how to swap the XYZ Min and Max Endstop pins in the Azteeg X3 Pro. It only comes with one set of connectors and they're Min Endstops. My previous experience didn't turn out well trying to tell the firmware to home to the Min Endstops so the best solution I found was to swap the pins in the firmware. If I'm missing a conflict with a setup other than delta please let me know, but it makes sense in my setup. --- Marlin/Configuration.h | 22 +++++++++++++++++++ Marlin/Marlin_main.cpp | 9 ++++++++ Marlin/dogm_lcd_implementation.h | 3 +++ .../Hephestos/Configuration.h | 22 +++++++++++++++++++ .../K8200/Configuration.h | 22 +++++++++++++++++++ .../SCARA/Configuration.h | 22 +++++++++++++++++++ .../WITBOX/Configuration.h | 22 +++++++++++++++++++ .../delta/Configuration.h | 22 +++++++++++++++++++ .../makibox/Configuration.h | 22 +++++++++++++++++++ .../tvrrug/Round2/Configuration.h | 22 +++++++++++++++++++ 10 files changed, 188 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ea4bf9600..68cd20135 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -584,6 +584,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller //#define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -617,6 +623,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e42b33f41..ca6311d83 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -632,6 +632,15 @@ void setup() digitalWrite(SERVO0_PIN, LOW); // turn it off #endif // Z_PROBE_SLED setup_homepin(); + +#ifdef STAT_LED_RED + pinMode(STAT_LED_RED, OUTPUT); + digitalWrite(STAT_LED_RED, LOW); // turn it off +#endif +#ifdef STAT_LED_BLUE + pinMode(STAT_LED_BLUE, OUTPUT); + digitalWrite(STAT_LED_BLUE, LOW); // turn it off +#endif } diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 1ccff63e3..f512d3295 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -92,6 +92,9 @@ U8GLIB_ST7920_128X64_RRD u8g(0); #elif defined(MAKRPANEL) // The MaKrPanel display, ST7565 controller as well U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); +#elif defined(VIKI2) || defined(miniVIKI) +// Mini Viki and Viki 2.0 LCD, ST7565 controller as well +U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); #else // for regular DOGM128 display with HW-SPI U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index c5554546e..9df2c5a67 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -590,6 +590,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller #define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -623,6 +629,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index eb53407ff..d3992890f 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -600,6 +600,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller //#define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -633,6 +639,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 9a165a3c6..6b465f29d 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -593,6 +593,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller //#define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -626,6 +632,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 26302076b..3d974b154 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -594,6 +594,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller #define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -627,6 +633,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 diff --git a/Marlin/example_configurations/delta/Configuration.h b/Marlin/example_configurations/delta/Configuration.h index d3a6f7fcc..6306ddc50 100644 --- a/Marlin/example_configurations/delta/Configuration.h +++ b/Marlin/example_configurations/delta/Configuration.h @@ -498,6 +498,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller //#define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -538,6 +544,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index be3b0f69d..03fdee783 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -568,6 +568,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller //#define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -601,6 +607,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4c01596ce..6ca7bad6a 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -581,6 +581,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // http://reprap.org/wiki/MaKr3d_MaKrPanel //#define MAKRPANEL +// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD +// http://panucatt.com +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +//#define VIKI2 +//#define miniVIKI + // The RepRapDiscount Smart Controller (white PCB) // http://reprap.org/wiki/RepRapDiscount_Smart_Controller //#define REPRAP_DISCOUNT_SMART_CONTROLLER @@ -614,6 +620,22 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_LCD_CONTRAST 17 #endif +#if defined(miniVIKI) || defined(VIKI2) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #ifdef miniVIKI + #define DEFAULT_LCD_CONTRAST 95 + #else + #define DEFAULT_LCD_CONTRAST 40 + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 +#endif + + #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 From f4b0a40abb6cf31d742eb1b180605346b8fef942 Mon Sep 17 00:00:00 2001 From: Natealus Date: Sun, 8 Feb 2015 15:43:58 -0700 Subject: [PATCH 5/9] Additional fixes to temperature.cpp and found another missing line Looks like INVERT_E3_DIR was missing in the configuration.h also as I did a test compile with 4 extruders and Azteeg X3 Pro defined. So I also added those lines too. Additional formatting to make the comments line up better in that section. --- Marlin/Configuration.h | 5 +++-- Marlin/example_configurations/Hephestos/Configuration.h | 3 ++- Marlin/example_configurations/K8200/Configuration.h | 5 +++-- Marlin/example_configurations/SCARA/Configuration.h | 3 ++- Marlin/example_configurations/WITBOX/Configuration.h | 5 +++-- Marlin/example_configurations/delta/Configuration.h | 3 ++- Marlin/example_configurations/makibox/Configuration.h | 5 +++-- .../example_configurations/tvrrug/Round2/Configuration.h | 7 ++++--- Marlin/temperature.cpp | 3 +++ 9 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 68cd20135..c05c3a0e3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -344,12 +344,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true +#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 9df2c5a67..93a0f1809 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -354,8 +354,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index d3992890f..e17ee9e33 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -360,10 +360,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define INVERT_X_DIR false // for Mendel set to false, for Orca set to true #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true +#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 6b465f29d..43a94f705 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -383,8 +383,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstop s when homing; 1=MAX, -1=MIN diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 3d974b154..02aa94b2d 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -354,12 +354,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true +#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN diff --git a/Marlin/example_configurations/delta/Configuration.h b/Marlin/example_configurations/delta/Configuration.h index 6306ddc50..ba5f6590a 100644 --- a/Marlin/example_configurations/delta/Configuration.h +++ b/Marlin/example_configurations/delta/Configuration.h @@ -371,8 +371,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define INVERT_Z_DIR false #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 03fdee783..e054918b9 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -355,9 +355,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define INVERT_X_DIR false // for Mendel set to false, for Orca set to true #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 6ca7bad6a..fccc267f2 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -356,11 +356,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled #define INVERT_X_DIR false // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true +#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false +#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index b04ea4d96..3936c2f05 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -460,11 +460,14 @@ void checkExtruderAutoFans() #endif #if defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1 if (EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN + && EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_2_AUTO_FAN_PIN, (fanState & 4) != 0); #endif #if defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN > -1 if (EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN + && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) + && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_2_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_3_AUTO_FAN_PIN, (fanState & 8) != 0); #endif From b3bda57ca25757ad78d432967c5a524220a14795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20FRANCOIS?= Date: Wed, 11 Feb 2015 07:12:02 +0100 Subject: [PATCH 6/9] reverted to upstream --- Marlin/Configuration_adv.h | 4 ++-- Marlin/example_configurations/delta/Configuration.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 5cda92101..4d3579d24 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -213,7 +213,7 @@ //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 -#define Z_HOME_RETRACT_MM 5 +#define Z_HOME_RETRACT_MM 2 //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -248,7 +248,7 @@ #define DEFAULT_MINSEGMENTTIME 20000 // If defined the movements slow down when the look ahead buffer is only half full -// #define SLOWDOWN // JFR - important, was enabled!! +#define SLOWDOWN // Frequency limit // See nophead's blog for more info diff --git a/Marlin/example_configurations/delta/Configuration.h b/Marlin/example_configurations/delta/Configuration.h index d50d3cfca..3eb268041 100644 --- a/Marlin/example_configurations/delta/Configuration.h +++ b/Marlin/example_configurations/delta/Configuration.h @@ -88,6 +88,8 @@ Here are some standard links for getting your machine calibrated: // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 200 +// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them + // Center-to-center distance of the holes in the diagonal push rods. #define DELTA_DIAGONAL_ROD 250.0 // mm From 22a79854456f1da5f966a683be1e8a64555e065f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20FRANCOIS?= Date: Wed, 11 Feb 2015 07:12:55 +0100 Subject: [PATCH 7/9] reverted to upstream --- Marlin/Marlin.pde | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Marlin/Marlin.pde diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde new file mode 100644 index 000000000..79c934bf0 --- /dev/null +++ b/Marlin/Marlin.pde @@ -0,0 +1,56 @@ +/* -*- c++ -*- */ + +/* + Reprap firmware 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 firmware is a mashup between Sprinter and grbl. + (https://github.com/kliment/Sprinter) + (https://github.com/simen/grbl/tree) + + It has preliminary support for Matthew Roberts advance algorithm + http://reprap.org/pipermail/reprap-dev/2011-May/003323.html + */ + +/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */ +/* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */ + +#include "Configuration.h" +#include "pins.h" + +#ifdef ULTRA_LCD + #if defined(LCD_I2C_TYPE_PCF8575) + #include + #include + #elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008) + #include + #include + #elif defined(DOGLCD) + #include // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/) + #else + #include // library for character LCD + #endif +#endif + +#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1 +#include +#endif + +#if defined(DIGIPOT_I2C) + #include +#endif From ea9e49b20d9964bf5bbbc73c9bddfe2d27fc865b Mon Sep 17 00:00:00 2001 From: Natealus Date: Thu, 12 Feb 2015 00:56:47 -0700 Subject: [PATCH 8/9] ARRAY_BY_EXTRUDERS 4th hotend PID parameters --- Marlin/temperature.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 3936c2f05..d5bd2d63d 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -136,11 +136,11 @@ static volatile bool temp_meas_ready = false; #ifdef PIDTEMP #ifdef PID_PARAMS_PER_EXTRUDER - float Kp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kp, DEFAULT_Kp, DEFAULT_Kp); - float Ki[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Ki*PID_dT, DEFAULT_Ki*PID_dT, DEFAULT_Ki*PID_dT); - float Kd[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kd / PID_dT, DEFAULT_Kd / PID_dT, DEFAULT_Kd / PID_dT); + float Kp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kp, DEFAULT_Kp, DEFAULT_Kp, DEFAULT_Kp); + float Ki[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Ki*PID_dT, DEFAULT_Ki*PID_dT, DEFAULT_Ki*PID_dT, DEFAULT_Ki*PID_dT); + float Kd[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kd / PID_dT, DEFAULT_Kd / PID_dT, DEFAULT_Kd / PID_dT, DEFAULT_Kd / PID_dT); #ifdef PID_ADD_EXTRUSION_RATE - float Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kc, DEFAULT_Kc, DEFAULT_Kc); + float Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kc, DEFAULT_Kc, DEFAULT_Kc, DEFAULT_Kc); #endif // PID_ADD_EXTRUSION_RATE #else //PID_PARAMS_PER_EXTRUDER float Kp = DEFAULT_Kp; From afc737ca0c8493603881a184f27bd245a943d25c Mon Sep 17 00:00:00 2001 From: alexborro Date: Fri, 13 Feb 2015 14:38:05 -0200 Subject: [PATCH 9/9] Fix CoreXY Homing Routine. Fixed how stepper ISR figure it out when the head (extruder) is going to Min or Max direction. Added Homing to Max Endstops. --- Marlin/Configuration.h | 5 ----- Marlin/planner.cpp | 12 ++++++++++-- Marlin/stepper.cpp | 16 ++++++++++------ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fef159330..41e1ed7ed 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -326,11 +326,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS -// Disable max endstops for compatibility with endstop checking routine -#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS) - #define DISABLE_MAX_ENDSTOPS -#endif - // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 #define X_ENABLE_ON 0 #define Y_ENABLE_ON 0 diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 82702286b..cee1981bc 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -629,13 +629,21 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi block->direction_bits |= (1<direction_bits |= (1<direction_bits |= (1<direction_bits |= (1<direction_bits |= (1<direction_bits |= (1<direction_bits |= (1< -1 @@ -465,7 +468,8 @@ ISR(TIMER1_COMPA_vect) #endif } } - else { // +direction + else + { // +direction CHECK_ENDSTOPS { #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1