Commit 22f2ce3f authored by MagoKimbra's avatar MagoKimbra

Update

parent edcc4c13
......@@ -47,7 +47,7 @@
* M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
* M49 - Z probe repetability test
* M80 - Turn on Power Supply
* M81 - Turn off Power Supply
* M81 - Turn off Power, including Power Supply, if possible
* M82 - Set E codes absolute (default)
* M83 - Set E codes relative while in Absolute Coordinates (G90) mode
* M84 - Disable steppers until next move, or use S[seconds] to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout.
......
......@@ -159,6 +159,31 @@
#define CONDITIONALS_H
#ifndef AT90USB
#define HardwareSerial_h // trick to disable the standard HWserial
#endif
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "pins.h"
/**
* ENDSTOPPULLUPS
*/
#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
#define ENDSTOPPULLUP_EMIN
#endif
/**
* Firmware Test
*/
......@@ -184,18 +209,6 @@
#define DRIVER_EXTRUDERS EXTRUDERS // This defines the number of Driver extruder
#endif
#ifndef AT90USB
#define HardwareSerial_h // trick to disable the standard HWserial
#endif
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "pins.h"
/**
* Axis lengths
*/
......@@ -286,16 +299,14 @@
#ifndef POWER_SUPPLY
#define POWER_SUPPLY 0
#endif
// 0 = Normal - 1 = ATX
#if (POWER_SUPPLY <= 1)
#if (POWER_SUPPLY == 1) // 1 = ATX
#define PS_ON_AWAKE LOW
#define PS_ON_ASLEEP HIGH
#endif
// 2 = X-Box 360 203W
#if (POWER_SUPPLY == 2)
#elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W
#define PS_ON_AWAKE HIGH
#define PS_ON_ASLEEP LOW
#endif
#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0)
/**
* Temp Sensor defines
......
......@@ -147,7 +147,7 @@
// 10 is 100k RS thermistor 198-961 (4.7k pullup)
// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
//
......@@ -582,7 +582,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
// Support for BlinkM/CyzRgb
//#define BLINKM
// Support for STEPPERS TOSHIBA
// Enable this option for Toshiba steppers
//#define CONFIG_STEPPERS_TOSHIBA
// Setting firmware for filament end switch
......
......@@ -274,7 +274,7 @@ void Config_RetrieveSettings()
void Config_ResetDefault()
{
//Setting default baudrate for serial
baudrate=BAUDRATE;
baudrate = BAUDRATE;
float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
float tmp2[] = DEFAULT_MAX_FEEDRATE;
......@@ -286,9 +286,9 @@ void Config_ResetDefault()
float tmp7[] = DEFAULT_Kd;
#endif // PIDTEMP
#if defined(EXTRUDER_OFFSET_X) && defined(EXTRUDER_OFFSET_Y)
float tmp8[] = EXTRUDER_OFFSET_X;
float tmp9[] = EXTRUDER_OFFSET_Y;
#if defined(HOTEND_OFFSET_X) && defined(HOTEND_OFFSET_Y)
float tmp8[] = HOTEND_OFFSET_X;
float tmp9[] = HOTEND_OFFSET_Y;
#else
float tmp8[] = {0,0,0,0};
float tmp9[] = {0,0,0,0};
......@@ -303,8 +303,8 @@ void Config_ResetDefault()
for (int i = 0; i < EXTRUDERS; i++) {
max_retraction_feedrate[i] = tmp3[i];
#if HOTENDS > 1
hotend_offset[i][X_AXIS] = tmp8[i];
hotend_offset[i][Y_AXIS] = tmp9[i];
hotend_offset[X_AXIS][i] = tmp8[i];
hotend_offset[Y_AXIS][i] = tmp9[i];
#endif
#ifdef SCARA
if (i < sizeof(axis_scaling) / sizeof(*axis_scaling))
......
......@@ -19,17 +19,7 @@
// #define ENDSTOPPULLUP_EMIN
#endif
#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
#define ENDSTOPPULLUP_EMIN
#endif
// The pullups are needed if you directly connect a mechanical end switch between the signal and ground pins.
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
......@@ -62,7 +52,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log
#define DISABLE_E false // For all extruder
#define DISABLE_INACTIVE_EXTRUDER false //disable only inactive extruder and keep active extruder enabled
// If you motor turns to wrong direction, you can invert it here:
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false
......@@ -71,7 +61,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log
#define INVERT_E2_DIR false
#define INVERT_E3_DIR false
// Travel limits after homing
// Travel limits after homing (units are in mm)
#define X_MAX_POS 200
#define X_MIN_POS 0
#define Y_MAX_POS 200
......@@ -143,8 +133,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets MUST be INTEGERS
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // -front +behind
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
......@@ -152,6 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log
#define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points
#define Z_RAISE_AFTER_PROBING 5 //How much the extruder will be raised after the last probing point.
//#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 pick up the sled. 0 should be fine but you can push it further if you'd like.
......@@ -170,9 +161,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log
//#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_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0
#ifdef MANUAL_HOME_POSITIONS
#define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0
#endif
// MOVEMENT SETTINGS
#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
......@@ -207,6 +200,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log
//#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -15
#define Z_PROBE_OFFSET_RANGE_MAX -5
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20
#endif
......@@ -19,17 +19,7 @@
// #define ENDSTOPPULLUP_EMIN
#endif
#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
#define ENDSTOPPULLUP_EMIN
#endif
// The pullups are needed if you directly connect a mechanical end switch between the signal and ground pins.
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
......@@ -62,7 +52,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define DISABLE_E false // For all extruder
#define DISABLE_INACTIVE_EXTRUDER false //disable only inactive extruder and keep active extruder enabled
// If you motor turns to wrong direction, you can invert it here:
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false
......@@ -71,7 +61,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define INVERT_E2_DIR false
#define INVERT_E3_DIR false
// Travel limits after homing
// Travel limits after homing (units are in mm)
#define X_MAX_POS 200
#define X_MIN_POS 0
#define Y_MAX_POS 200
......@@ -80,10 +70,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define Z_MIN_POS 0
#define E_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 Manual or Auto Leveling ===========================
//=====================================================================================
......@@ -147,8 +133,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // -front +behind
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
......@@ -156,6 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points
#define Z_RAISE_AFTER_PROBING 5 //How much the extruder will be raised after the last probing point.
//#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 pick up the sled. 0 should be fine but you can push it further if you'd like.
......@@ -174,9 +161,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
//#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_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0
#ifdef MANUAL_HOME_POSITIONS
#define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0
#endif
// MOVEMENT SETTINGS
#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
......@@ -211,6 +200,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
//#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -15
#define Z_PROBE_OFFSET_RANGE_MAX -5
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20
#endif
......@@ -43,17 +43,7 @@
// #define ENDSTOPPULLUP_ZMIN
#endif
#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
#define ENDSTOPPULLUP_EMIN
#endif
// The pullups are needed if you directly connect a mechanical end switch between the signal and ground pins.
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
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.
......@@ -86,7 +76,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
#define DISABLE_E false // For all extruder
#define DISABLE_INACTIVE_EXTRUDER false //disable only inactive extruder and keep active extruder enabled
// If you motor turns to wrong direction, you can invert it here:
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR true
......@@ -95,7 +85,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
#define INVERT_E2_DIR false
#define INVERT_E3_DIR false
// Travel limits after homing
// Travel limits after homing (units are in mm)
#define X_MAX_POS 200
#define X_MIN_POS 0
#define Y_MAX_POS 200
......@@ -104,10 +94,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
#define Z_MIN_POS MANUAL_Z_HOME_POS
#define E_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 Manual or Auto Leveling ===========================
//=====================================================================================
......@@ -118,7 +104,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
#define FRONT_PROBE_BED_POSITION 20
#define BACK_PROBE_BED_POSITION 180
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#define XY_TRAVEL_SPEED 10000 // X and Y axis travel speed between probes, in mm/min
//If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
......@@ -171,8 +157,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // -front +behind
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1 // -below (always!)
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
......@@ -180,6 +166,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
#define Z_RAISE_BEFORE_PROBING 10 //How much the extruder will be raised before travelling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when travelling from between next probing points
#define Z_RAISE_AFTER_PROBING 5 //How much the extruder will be raised after the last probing point.
//#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 pick up the sled. 0 should be fine but you can push it further if you'd like.
......@@ -194,14 +181,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
// The position of the homing switches
//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations:
// For SCARA: Offset between HomingPosition and Bed X=0 / Y=0
#ifdef MANUAL_HOME_POSITIONS
#define MANUAL_X_HOME_POS -22
#define MANUAL_Y_HOME_POS -52
#define MANUAL_Z_HOME_POS 0.1 // Distance between nozzle and print surface after homing.
#endif
// MOVEMENT SETTINGS
#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
......@@ -236,6 +225,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
//#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -15
#define Z_PROBE_OFFSET_RANGE_MAX -5
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20
#endif
......@@ -115,28 +115,27 @@
#ifdef Z_DUAL_STEPPER_DRIVERS
// Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
// That way the machine is capable to align the bed during home, since both Z steppers are homed.
// There is also an implementation of M666 (software endstops adjustment) to this feature.
// After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
// One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2.
// If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive.
// Play a little bit with small adjustments (0.5mm) and check the behaviour.
// The M119 (endstops report) will start reporting the Z2 Endstop as well.
#define Z_DUAL_ENDSTOPS
#ifdef Z_DUAL_ENDSTOPS
// Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
// That way the machine is capable to align the bed during home, since both Z steppers are homed.
// There is also an implementation of M666 (software endstops adjustment) to this feature.
// After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
// One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2.
// If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive.
// Play a little bit with small adjustments (0.5mm) and check the behaviour.
// The M119 (endstops report) will start reporting the Z2 Endstop as well.
#define Z_DUAL_ENDSTOPS
#ifdef Z_DUAL_ENDSTOPS
#define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis.
#define Z2_DIR_PIN E2_DIR_PIN
#define Z2_ENABLE_PIN E2_ENABLE_PIN
#define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
const bool Z2_MAX_ENDSTOP_INVERTING = false;
#define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
#endif
#endif
#endif
#endif // Z_DUAL_STEPPER_DRIVERS
// Same again but for Y Axis.
//#define Y_DUAL_STEPPER_DRIVERS
......@@ -248,34 +247,44 @@
//===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiple the steps moved by 100 to really quickly advance the value
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
#ifdef SDSUPPORT
// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should
// be commented out otherwise
#define SDCARDDETECTINVERTED
#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order.
// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
// using:
//#define MENU_ADDAUTOSTART
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
//========================= LCD PROGRESS BAR ======================
// Show a progress bar on HD44780 LCDs for SD printing
//#define LCD_PROGRESS_BAR
#ifdef LCD_PROGRESS_BAR
#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order.
// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
// using:
//#define MENU_ADDAUTOSTART
// Show a progress bar on HD44780 LCDs for SD printing
//#define LCD_PROGRESS_BAR
#ifdef LCD_PROGRESS_BAR
// Amount of time (ms) to show the bar
#define PROGRESS_BAR_BAR_TIME 2000
#define PROGRESS_BAR_BAR_TIME 5000
// Amount of time (ms) to show the status message
#define PROGRESS_BAR_MSG_TIME 3000
#define PROGRESS_BAR_MSG_TIME 1500
// Amount of time (ms) to retain the status message (0=forever)
#define PROGRESS_MSG_EXPIRE 0
// Enable this to show messages for MSG_TIME then hide them
//#define PROGRESS_MSG_ONCE
#endif
#endif
#endif // SDSUPPORT
// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
//#define USE_WATCHDOG
......@@ -321,12 +330,6 @@
const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
// in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should
// be commented out otherwise
#define SDCARDDETECTINVERTED
// Control heater 0 and heater 1 in parallel.
//#define HEATERS_PARALLEL
......
......@@ -257,7 +257,7 @@ extern float home_offset[3];
#else
#define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane
#endif
extern float hotend_offset[HOTENDS][NUM_HOTEND_OFFSETS];
extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS];
#endif // HOTENDS > 1
#ifdef NPR2
......
This diff is collapsed.
......@@ -17,8 +17,11 @@
* Progress Bar
*/
#ifdef LCD_PROGRESS_BAR
#ifndef SDSUPPORT
#error LCD_PROGRESS_BAR requires SDSUPPORT.
#endif
#ifdef DOGLCD
#warning LCD_PROGRESS_BAR does not apply to graphical displays.
#error LCD_PROGRESS_BAR does not apply to graphical displays.
#endif
#ifdef FILAMENT_LCD_DISPLAY
#error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
......
......@@ -358,12 +358,12 @@ static void lcd_implementation_status_screen() {
#else
u8g.setPrintPos(0,63);
#endif
#if HAS_FILAMENT_SENSOR
#if HAS_FILAMENT_SENSOR || HAS_POWER_CONSUMPTION_SENSOR
if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message);
}
#if (defined(POWER_CONSUMPTION) && defined(POWER_CONSUMPTION_PIN) && POWER_CONSUMPTION_PIN >= 0) && defined(POWER_CONSUMPTION_LCD_DISPLAY)
#if (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0) && defined(FILAMENT_LCD_DISPLAY)
#if HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY)
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)
else if (millis() < message_millis + 10000)
#else
else
......@@ -376,7 +376,7 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR("Wh"));
}
#endif
#if (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0) && defined(FILAMENT_LCD_DISPLAY)
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)
else {
lcd_printPGM(PSTR("D:"));
lcd_print(ftostr12ns(filament_width_meas));
......
......@@ -150,6 +150,9 @@
#define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_END_HOUR "hours"
#define MSG_END_MINUTE "minutes"
#ifdef DELTA
#define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X"
......
......@@ -146,6 +146,9 @@
#define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_END_HOUR "ore"
#define MSG_END_MINUTE "minuti"
#ifdef DELTA
#define MSG_DELTA_CALIBRATE "Calibraz. Delta"
#define MSG_DELTA_CALIBRATE_X "Calibra X"
......
......@@ -441,7 +441,9 @@ ISR(TIMER1_COMPA_vect) {
{
current_block = NULL;
plan_discard_current_block();
#ifdef SD_FINISHED_RELEASECOMMAND
if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
#endif
cleaning_buffer_counter--;
OCR1A = 200;
return;
......@@ -564,74 +566,98 @@ ISR(TIMER1_COMPA_vect) {
}
if (TEST(out_bits, Z_AXIS)) { // -direction
Z_APPLY_DIR(INVERT_Z_DIR,0);
count_direction[Z_AXIS] = -1;
if (check_endstops)
{
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1
#ifndef Z_DUAL_ENDSTOPS
UPDATE_ENDSTOP(z, Z, min, MIN);
#else
bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
#if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1
bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING);
if (check_endstops) {
#if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
#ifdef Z_DUAL_ENDSTOPS
bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING,
z2_min_endstop =
#if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING
#else
bool z2_min_endstop=z_min_endstop;
z_min_endstop
#endif
if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0))
{
;
bool z_min_both = z_min_endstop && old_z_min_endstop,
z2_min_both = z2_min_endstop && old_z2_min_endstop;
if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_hit=true;
if (!(performing_homing) || ((performing_homing)&&(z_min_endstop && old_z_min_endstop)&&(z2_min_endstop && old_z2_min_endstop))) //if not performing home or if both endstops were trigged during homing...
{
endstop_z_hit = true;
if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing...
step_events_completed = current_block->step_event_count;
}
}
old_z_min_endstop = z_min_endstop;
old_z2_min_endstop = z2_min_endstop;
#endif
#endif
}
#else // !Z_DUAL_ENDSTOPS
UPDATE_ENDSTOP(z, Z, min, MIN);
#endif // !Z_DUAL_ENDSTOPS
#endif // Z_MIN_PIN
} // check_endstops
}
else { // +direction
Z_APPLY_DIR(!INVERT_Z_DIR,0);
count_direction[Z_AXIS] = 1;
if (check_endstops) {
#if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
#ifndef Z_DUAL_ENDSTOPS
UPDATE_ENDSTOP(z, Z, max, MAX);
#else
bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING);
#if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1
bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING);
#ifdef Z_DUAL_ENDSTOPS
bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING,
z2_max_endstop =
#if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING
#else
bool z2_max_endstop=z_max_endstop;
z_max_endstop
#endif
if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0))
{
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_hit=true;
;
// if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true");
// if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true");
bool z_max_both = z_max_endstop && old_z_max_endstop,
z2_max_both = z2_max_endstop && old_z2_max_endstop;
if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_hit = true;
// if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true");
// if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true");
if (!(performing_homing) || ((performing_homing)&&(z_max_endstop && old_z_max_endstop)&&(z2_max_endstop && old_z2_max_endstop))) //if not performing home or if both endstops were trigged during homing...
{
if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing...
step_events_completed = current_block->step_event_count;
}
}
old_z_max_endstop = z_max_endstop;
old_z2_max_endstop = z2_max_endstop;
#endif
#endif
}
}
#else // !Z_DUAL_ENDSTOPS
UPDATE_ENDSTOP(z, Z, max, MAX);
#endif // !Z_DUAL_ENDSTOPS
#endif // Z_MAX_PIN
} // check_endstops
} // +direction
#ifndef ADVANCE
if (TEST(out_bits, E_AXIS)) { // -direction
REV_E_DIR();
count_direction[E_AXIS]=-1;
count_direction[E_AXIS] = -1;
#ifdef NPR2
if (check_endstops) {
#if defined(E_MIN_PIN) && E_MIN_PIN > -1
......@@ -648,12 +674,12 @@ ISR(TIMER1_COMPA_vect) {
}
else { // +direction
NORM_E_DIR();
count_direction[E_AXIS]=1;
count_direction[E_AXIS] = 1;
}
#endif //!ADVANCE
// Take multiple steps per interrupt (For high speed moves)
for (int8_t i=0; i < step_loops; i++) {
for (int8_t i = 0; i < step_loops; i++) {
#ifndef AT90USB
MSerial.checkRx(); // Check for serial chars.
#endif
......@@ -856,6 +882,7 @@ ISR(TIMER1_COMPA_vect) {
}
}
#endif
}
}
#endif // ADVANCE
......
This diff is collapsed.
......@@ -8,16 +8,20 @@
int lcd_strlen_P(const char *s);
void lcd_update();
void lcd_init();
void lcd_setstatus(const char* message);
void lcd_setstatuspgm(const char* message);
void lcd_setstatus(const char* message, const bool persist=false);
void lcd_setstatuspgm(const char* message, const uint8_t level=0);
void lcd_setalertstatuspgm(const char* message);
void lcd_reset_alert_level();
bool lcd_detected(void);
#if defined(DOGLCD) && LCD_CONTRAST >= 0
#if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
void dontExpireStatus();
#endif
#if defined(DOGLCD) && LCD_CONTRAST >= 0
extern int lcd_contrast;
void lcd_setcontrast(uint8_t value);
#endif
#endif
void set_pageShowInfo(int value);
void set_ChangeScreen(boolean state);
......@@ -54,7 +58,7 @@
extern bool cancel_heatup;
#if (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0) && defined(FILAMENT_LCD_DISPLAY) || (defined(POWER_CONSUMPTION) && defined(POWER_CONSUMPTION_PIN) && POWER_CONSUMPTION_PIN >= 0) && defined(POWER_CONSUMPTION_LCD_DISPLAY)
#if (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)) || (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY))
extern unsigned long message_millis;
#endif
......
......@@ -193,10 +193,10 @@
#include "utf_mapper.h"
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
static uint16_t progressBarTick = 0;
#if PROGRESS_MSG_EXPIRE > 0
static uint16_t messageTick = 0;
static uint16_t expireStatusMillis = 0;
#endif
#define LCD_STR_PROGRESS "\x03\x04\x05"
#endif
......@@ -214,7 +214,7 @@
#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
static void lcd_set_custom_characters(
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
bool progress_bar_set=true
#endif
) {
......@@ -316,7 +316,7 @@ static void lcd_set_custom_characters(
B00000
}; //thanks Sonny Mounicou
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
static bool char_mode = false;
byte progress[3][8] = { {
B00000,
......@@ -376,9 +376,9 @@ static void lcd_set_custom_characters(
#endif
}
static void lcd_implementation_init (
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
bool progress_bar_set = true
static void lcd_implementation_init(
#ifdef LCD_PROGRESS_BAR
bool progress_bar_set=true
#endif
) {
......@@ -404,7 +404,7 @@ static void lcd_implementation_init (
#endif
lcd_set_custom_characters(
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
progress_bar_set
#endif
);
......@@ -594,8 +594,7 @@ static void lcd_implementation_status_screen()
lcd.print(':');
lcd.print(itostr2(time%60));
}
else
{
else {
lcd_printPGM(PSTR("--:--"));
}
#endif
......@@ -603,7 +602,8 @@ static void lcd_implementation_status_screen()
// Status message line at the bottom
lcd.setCursor(0, LCD_HEIGHT - 1);
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
if (card.isFileOpen()) {
uint16_t mil = millis(), diff = mil - progressBarTick;
if (diff >= PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
......@@ -627,12 +627,12 @@ static void lcd_implementation_status_screen()
#endif //LCD_PROGRESS_BAR
//Display both Status message line and Filament display on the last line
#if (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0) && defined(FILAMENT_LCD_DISPLAY) || (defined(POWER_CONSUMPTION) && defined(POWER_CONSUMPTION_PIN) && POWER_CONSUMPTION_PIN >= 0) && defined(POWER_CONSUMPTION_LCD_DISPLAY)
#if (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)) || (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY))
if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message);
}
#if defined(POWER_CONSUMPTION) && defined(POWER_CONSUMPTION_PIN) && (POWER_CONSUMPTION_PIN >= 0) && defined(POWER_CONSUMPTION_LCD_DISPLAY)
#if defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && (FILWIDTH_PIN >= 0) && defined(FILAMENT_LCD_DISPLAY)
#if HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY)
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)
else if (millis() < message_millis + 10000)
#else
else
......@@ -645,7 +645,7 @@ static void lcd_implementation_status_screen()
lcd_printPGM(PSTR("Wh"));
}
#endif
#if defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && (FILWIDTH_PIN >= 0) && defined(FILAMENT_LCD_DISPLAY)
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)
else {
lcd_printPGM(PSTR("D:"));
lcd.print(ftostr12ns(filament_width_meas));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment