Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into update_menu_plan

This commit is contained in:
Cylindric 2014-02-20 14:12:10 +00:00
commit 3cc7626d1f
16 changed files with 760 additions and 495 deletions

View File

@ -8,7 +8,7 @@
//=========================================================================== //===========================================================================
//============================= DELTA Printer =============================== //============================= DELTA Printer ===============================
//=========================================================================== //===========================================================================
// For a Delta printer rplace the configuration files wilth the files in the // For a Delta printer replace the configuration files with the files in the
// example_configurations/delta directory. // example_configurations/delta directory.
// //
@ -55,6 +55,7 @@
// 68 = Azteeg X3 Pro // 68 = Azteeg X3 Pro
// 7 = Ultimaker // 7 = Ultimaker
// 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare) // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
// 72 = Ultimainboard 2.x (Uses TEMP_SENSOR 20)
// 77 = 3Drag Controller // 77 = 3Drag Controller
// 8 = Teensylu // 8 = Teensylu
// 80 = Rumba // 80 = Rumba
@ -105,7 +106,7 @@
// 0 is not used // 0 is not used
// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup) // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
// 3 is mendel-parts thermistor (4.7k pullup) // 3 is Mendel-parts thermistor (4.7k pullup)
// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
@ -114,13 +115,19 @@
// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
// 10 is 100k RS thermistor 198-961 (4.7k pullup) // 10 is 100k RS thermistor 198-961 (4.7k pullup)
// 60 is 100k Maker's Tool Works Kapton Bed Thermister // 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor
// //
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
// (but gives greater accuracy and more stable PID) // (but gives greater accuracy and more stable PID)
// 51 is 100k thermistor - EPCOS (1k pullup) // 51 is 100k thermistor - EPCOS (1k pullup)
// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup) // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
//
// 1047 is Pt1000 with 4k7 pullup
// 1010 is Pt1000 with 1k pullup (non standard)
// 147 is Pt100 with 4k7 pullup
// 110 is Pt100 with 1k pullup (non standard)
#define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_0 -1
#define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_1 -1
@ -175,13 +182,13 @@
#define K1 0.95 //smoothing factor within the PID #define K1 0.95 //smoothing factor within the PID
#define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine #define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
// If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// Ultimaker // Ultimaker
#define DEFAULT_Kp 22.2 #define DEFAULT_Kp 22.2
#define DEFAULT_Ki 1.08 #define DEFAULT_Ki 1.08
#define DEFAULT_Kd 114 #define DEFAULT_Kd 114
// Makergear // MakerGear
// #define DEFAULT_Kp 7.0 // #define DEFAULT_Kp 7.0
// #define DEFAULT_Ki 0.1 // #define DEFAULT_Ki 0.1
// #define DEFAULT_Kd 12 // #define DEFAULT_Kd 12
@ -250,7 +257,7 @@
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS #ifndef ENDSTOPPULLUPS
// fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX // #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX // #define ENDSTOPPULLUP_YMAX
// #define ENDSTOPPULLUP_ZMAX // #define ENDSTOPPULLUP_ZMAX
@ -334,7 +341,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define BACK_PROBE_BED_POSITION 180 #define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20
// these are the offsets to the prob relative to the extruder tip (Hotend - Probe) // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
#define X_PROBE_OFFSET_FROM_EXTRUDER -25 #define X_PROBE_OFFSET_FROM_EXTRUDER -25
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
@ -355,7 +362,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// #define PROBE_SERVO_DEACTIVATION_DELAY 300 // #define PROBE_SERVO_DEACTIVATION_DELAY 300
//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing, //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!!! //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. #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
@ -389,7 +396,7 @@ 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) //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations: //Manual homing switch locations:
// For deltabots this means top and center of the cartesian print volume. // For deltabots this means top and center of the Cartesian print volume.
#define MANUAL_X_HOME_POS 0 #define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0 #define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0 #define MANUAL_Z_HOME_POS 0
@ -403,7 +410,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#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_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_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. #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.
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #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 #define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
@ -424,11 +431,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//=========================================================================== //===========================================================================
// EEPROM // EEPROM
// the microcontroller can store settings in the EEPROM, e.g. max velocity... // The microcontroller can store settings in the EEPROM, e.g. max velocity...
// M500 - stores paramters in EEPROM // M500 - stores parameters in EEPROM
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
//define this to enable eeprom support //define this to enable EEPROM support
//#define EEPROM_SETTINGS //#define EEPROM_SETTINGS
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can. // please keep turned on if you can.
@ -444,14 +451,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 #define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
//LCD and SD support //LCD and SD support
//#define ULTRA_LCD //general lcd support, also 16x2 //#define ULTRA_LCD //general LCD support, also 16x2
//#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
//#define SDSUPPORT // Enable SD Card Support in Hardware Console //#define SDSUPPORT // Enable SD Card Support in Hardware Console
//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error) //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
//#define ULTIMAKERCONTROLLER //as available from the ultimaker online store. //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
//#define ULTIPANEL //the ultipanel as on thingiverse //#define ULTIPANEL //the UltiPanel as on Thingiverse
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
@ -592,7 +599,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define LCD_WIDTH 20 #define LCD_WIDTH 20
#define LCD_HEIGHT 4 #define LCD_HEIGHT 4
#endif #endif
#else //no panel but just lcd #else //no panel but just LCD
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
#ifdef DOGLCD // Change number of lines to match the 128x64 graphics display #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
#define LCD_WIDTH 20 #define LCD_WIDTH 20
@ -614,8 +621,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
//#define FAST_PWM_FAN //#define FAST_PWM_FAN
// Temperature status leds that display the hotend and bet temperature. // Temperature status LEDs that display the hotend and bet temperature.
// If alle hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis. // Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS //#define TEMP_STAT_LEDS

View File

@ -20,7 +20,7 @@
#ifdef PIDTEMP #ifdef PIDTEMP
// this adds an experimental additional term to the heating power, proportional to the extrusion speed. // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is choosen well, the additional required power due to increased melting should be compensated. // if Kc is chosen well, the additional required power due to increased melting should be compensated.
#define PID_ADD_EXTRUSION_RATE #define PID_ADD_EXTRUSION_RATE
#ifdef PID_ADD_EXTRUSION_RATE #ifdef PID_ADD_EXTRUSION_RATE
#define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed)
@ -34,7 +34,7 @@
// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp // the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
// you exit the value by any M109 without F* // you exit the value by any M109 without F*
// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp. // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
// on an ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
#define AUTOTEMP #define AUTOTEMP
#ifdef AUTOTEMP #ifdef AUTOTEMP
#define AUTOTEMP_OLDWEIGHT 0.98 #define AUTOTEMP_OLDWEIGHT 0.98
@ -283,11 +283,11 @@
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. #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 cronological. To still have auto0.g accessible, there is again the option to do that. // 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: // using:
//#define MENU_ADDAUTOSTART //#define MENU_ADDAUTOSTART
// The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. // 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 //#define USE_WATCHDOG
#ifdef USE_WATCHDOG #ifdef USE_WATCHDOG
@ -301,7 +301,7 @@
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
// it can e.g. be used to change z-positions in the print startup phase in realtime // it can e.g. be used to change z-positions in the print startup phase in real-time
// does not respect endstops! // does not respect endstops!
//#define BABYSTEPPING //#define BABYSTEPPING
#ifdef BABYSTEPPING #ifdef BABYSTEPPING
@ -324,8 +324,8 @@
// //
// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2 // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
// //
// hooke's law says: force = k * distance // Hooke's law says: force = k * distance
// bernoulli's priniciple says: v ^ 2 / 2 + g . h + pressure / density = constant // Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant
// so: v ^ 2 is proportional to number of steps we advance the extruder // so: v ^ 2 is proportional to number of steps we advance the extruder
//#define ADVANCE //#define ADVANCE
@ -379,7 +379,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
//=========================================================================== //===========================================================================
// The number of linear motions that can be in the plan at any give time. // The number of linear motions that can be in the plan at any give time.
// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
#if defined SDSUPPORT #if defined SDSUPPORT
#define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
#else #else
@ -387,20 +387,26 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#endif #endif
//The ASCII buffer for recieving from the serial: //The ASCII buffer for receiving from the serial:
#define MAX_CMD_SIZE 96 #define MAX_CMD_SIZE 96
#define BUFSIZE 4 #define BUFSIZE 4
// Firmware based and LCD controled retract // Firmware based and LCD controlled retract
// M207 and M208 can be used to define parameters for the retraction. // M207 and M208 can be used to define parameters for the retraction.
// The retraction can be called by the slicer using G10 and G11 // The retraction can be called by the slicer using G10 and G11
// until then, intended retractions can be detected by moves that only extrude and the direction. // until then, intended retractions can be detected by moves that only extrude and the direction.
// the moves are than replaced by the firmware controlled ones. // the moves are than replaced by the firmware controlled ones.
// #define FWRETRACT //ONLY PARTIALLY TESTED // #define FWRETRACT //ONLY PARTIALLY TESTED
#ifdef FWRETRACT
#define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
#define RETRACT_LENGTH 3 //default retract length (positive mm)
#define RETRACT_FEEDRATE 80*60 //default feedrate for retracting
#define RETRACT_ZLIFT 0 //default retract Z-lift
#define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
#define RETRACT_RECOVER_FEEDRATE 8*60 //default feedrate for recovering from retraction
#endif
//adds support for experimental filament exchange support M600; requires display //adds support for experimental filament exchange support M600; requires display
#ifdef ULTIPANEL #ifdef ULTIPANEL

View File

@ -11,7 +11,7 @@
#include "WProgram.h" #include "WProgram.h"
#endif #endif
// it is a russian alphabet translation // it is a Russian alphabet translation
// except 0401 --> 0xa2 = ╗, 0451 --> 0xb5 // except 0401 --> 0xa2 = ╗, 0451 --> 0xb5
const PROGMEM uint8_t utf_recode[] = const PROGMEM uint8_t utf_recode[] =
{ 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f, { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,
@ -115,7 +115,7 @@ void LiquidCrystalRus::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION! // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
// according to datasheet, we need at least 40ms after power rises above 2.7V // according to datasheet, we need at least 40ms after power rises above 2.7V
// before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50 // before sending commands. Arduino can turn on way before 4.5V so we'll wait 50
delayMicroseconds(50000); delayMicroseconds(50000);
// Now we pull both RS and R/W low to begin commands // Now we pull both RS and R/W low to begin commands
digitalWrite(_rs_pin, LOW); digitalWrite(_rs_pin, LOW);
@ -126,7 +126,7 @@ void LiquidCrystalRus::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
//put the LCD into 4 bit or 8 bit mode //put the LCD into 4 bit or 8 bit mode
if (! (_displayfunction & LCD_8BITMODE)) { if (! (_displayfunction & LCD_8BITMODE)) {
// this is according to the hitachi HD44780 datasheet // this is according to the Hitachi HD44780 datasheet
// figure 24, pg 46 // figure 24, pg 46
// we start in 8bit mode, try to set 4 bit mode // we start in 8bit mode, try to set 4 bit mode
@ -144,7 +144,7 @@ void LiquidCrystalRus::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
// finally, set to 8-bit interface // finally, set to 8-bit interface
writeNbits(0x02,4); writeNbits(0x02,4);
} else { } else {
// this is according to the hitachi HD44780 datasheet // this is according to the Hitachi HD44780 datasheet
// page 45 figure 23 // page 45 figure 23
// Send function set command sequence // Send function set command sequence
@ -308,7 +308,7 @@ inline void LiquidCrystalRus::command(uint8_t value) {
} }
} else send(out_char, HIGH); } else send(out_char, HIGH);
#if defined(ARDUINO) && ARDUINO >= 100 #if defined(ARDUINO) && ARDUINO >= 100
return 1; // assume sucess return 1; // assume success
#endif #endif
} }

View File

@ -236,7 +236,7 @@ VPATH += $(HARDWARE_DIR)/libraries/Wire
VPATH += $(HARDWARE_DIR)/libraries/Wire/utility VPATH += $(HARDWARE_DIR)/libraries/Wire/utility
VPATH += $(HARDWARE_DIR)/libraries/LiquidTWI2 VPATH += $(HARDWARE_DIR)/libraries/LiquidTWI2
endif endif
ifeq ($(WIRE, 1) ifeq ($(WIRE), 1)
VPATH += $(HARDWARE_DIR)/libraries/Wire VPATH += $(HARDWARE_DIR)/libraries/Wire
VPATH += $(HARDWARE_DIR)/libraries/Wire/utility VPATH += $(HARDWARE_DIR)/libraries/Wire/utility
endif endif
@ -260,7 +260,8 @@ CXXSRC = WMath.cpp WString.cpp Print.cpp Marlin_main.cpp \
MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp \ MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp \
SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp \ SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp \
stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \ stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
watchdog.cpp SPI.cpp Servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp watchdog.cpp SPI.cpp Servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
vector_3.cpp qr_solve.cpp
ifeq ($(LIQUID_TWI2), 0) ifeq ($(LIQUID_TWI2), 0)
CXXSRC += LiquidCrystal.cpp CXXSRC += LiquidCrystal.cpp
else else

View File

@ -189,6 +189,8 @@ void enquecommand_P(const char *cmd); //put an ascii command at the end of the c
void prepare_arc_move(char isclockwise); void prepare_arc_move(char isclockwise);
void clamp_to_software_endstops(float target[3]); void clamp_to_software_endstops(float target[3]);
void refresh_cmd_timeout(void);
#ifdef FAST_PWM_FAN #ifdef FAST_PWM_FAN
void setPwmFrequency(uint8_t pin, int val); void setPwmFrequency(uint8_t pin, int val);
#endif #endif

View File

@ -25,7 +25,7 @@
#ifndef AT90USB #ifndef AT90USB
// this next line disables the entire HardwareSerial.cpp, // this next line disables the entire HardwareSerial.cpp,
// this is so I can support Attiny series and any other chip without a uart // this is so I can support Attiny series and any other chip without a UART
#if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H) #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
#if UART_PRESENT(SERIAL_PORT) #if UART_PRESENT(SERIAL_PORT)

View File

@ -76,7 +76,7 @@
// G10 - retract filament according to settings of M207 // G10 - retract filament according to settings of M207
// G11 - retract recover filament according to settings of M208 // G11 - retract recover filament according to settings of M208
// G28 - Home all Axis // G28 - Home all Axis
// G29 - Detailed Z-Probe, probes the bed at 3 points. You must de at the home position for this to work correctly. // G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet.
// G30 - Single Z Probe, probes bed at current XY location. // G30 - Single Z Probe, probes bed at current XY location.
// G90 - Use Absolute Coordinates // G90 - Use Absolute Coordinates
// G91 - Use Relative Coordinates // G91 - Use Relative Coordinates
@ -137,8 +137,8 @@
// M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2 also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate // M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2 also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
// M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk // M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
// M206 - set additional homeing offset // M206 - set additional homeing offset
// M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop] // M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
// M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] // M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
// M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
// M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y> // M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
// M220 S<factor in percent>- set speed factor override percentage // M220 S<factor in percent>- set speed factor override percentage
@ -231,10 +231,13 @@ int EtoPPressure=0;
#endif #endif
#ifdef FWRETRACT #ifdef FWRETRACT
bool autoretract_enabled=true; bool autoretract_enabled=false;
bool retracted=false; bool retracted=false;
float retract_length=3, retract_feedrate=17*60, retract_zlift=0.8; float retract_length = RETRACT_LENGTH;
float retract_recover_length=0, retract_recover_feedrate=8*60; float retract_feedrate = RETRACT_FEEDRATE;
float retract_zlift = RETRACT_ZLIFT;
float retract_recover_length = RETRACT_RECOVER_LENGTH;
float retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
#endif #endif
#ifdef ULTIPANEL #ifdef ULTIPANEL
@ -978,6 +981,28 @@ static void retract_z_probe() {
#endif #endif
} }
/// Probe bed height at position (x,y), returns the measured z value
static float probe_pt(float x, float y, float z_before) {
// move to right place
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
engage_z_probe(); // Engage Z Servo endstop if available
run_z_probe();
float measured_z = current_position[Z_AXIS];
retract_z_probe();
SERIAL_PROTOCOLPGM(MSG_BED);
SERIAL_PROTOCOLPGM(" x: ");
SERIAL_PROTOCOL(x);
SERIAL_PROTOCOLPGM(" y: ");
SERIAL_PROTOCOL(y);
SERIAL_PROTOCOLPGM(" z: ");
SERIAL_PROTOCOL(measured_z);
SERIAL_PROTOCOLPGM("\n");
return measured_z;
}
#endif // #ifdef ENABLE_AUTO_BED_LEVELING #endif // #ifdef ENABLE_AUTO_BED_LEVELING
static void homeaxis(int axis) { static void homeaxis(int axis) {
@ -1058,6 +1083,46 @@ static void homeaxis(int axis) {
} }
} }
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
void refresh_cmd_timeout(void)
{
previous_millis_cmd = millis();
}
#ifdef FWRETRACT
void retract(bool retracting) {
if(retracting && !retracted) {
destination[X_AXIS]=current_position[X_AXIS];
destination[Y_AXIS]=current_position[Y_AXIS];
destination[Z_AXIS]=current_position[Z_AXIS];
destination[E_AXIS]=current_position[E_AXIS];
current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate;
feedrate=retract_feedrate;
retracted=true;
prepare_move();
current_position[Z_AXIS]-=retract_zlift;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
prepare_move();
feedrate = oldFeedrate;
} else if(!retracting && retracted) {
destination[X_AXIS]=current_position[X_AXIS];
destination[Y_AXIS]=current_position[Y_AXIS];
destination[Z_AXIS]=current_position[Z_AXIS];
destination[E_AXIS]=current_position[E_AXIS];
current_position[Z_AXIS]+=retract_zlift;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
//prepare_move();
current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate;
feedrate=retract_recover_feedrate;
retracted=false;
prepare_move();
feedrate = oldFeedrate;
}
} //retract
#endif //FWRETRACT
void process_commands() void process_commands()
{ {
@ -1074,6 +1139,18 @@ void process_commands()
case 1: // G1 case 1: // G1
if(Stopped == false) { if(Stopped == false) {
get_coordinates(); // For X Y Z E F get_coordinates(); // For X Y Z E F
#ifdef FWRETRACT
if(autoretract_enabled)
if( !(code_seen(X_AXIS) || code_seen(Y_AXIS) || code_seen(Z_AXIS)) && code_seen(E_AXIS)) {
float echange=destination[E_AXIS]-current_position[E_AXIS];
if((echange<-MIN_RETRACT && !retracted) || (echange>MIN_RETRACT && retracted)) { //move appears to be an attempt to attract or recover
current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations
plan_set_e_position(current_position[E_AXIS]); //AND from the planner
retract(!retracted);
return;
}
}
#endif //FWRETRACT
prepare_move(); prepare_move();
//ClearToSend(); //ClearToSend();
return; return;
@ -1108,31 +1185,10 @@ void process_commands()
break; break;
#ifdef FWRETRACT #ifdef FWRETRACT
case 10: // G10 retract case 10: // G10 retract
if(!retracted) retract(true);
{
destination[X_AXIS]=current_position[X_AXIS];
destination[Y_AXIS]=current_position[Y_AXIS];
destination[Z_AXIS]=current_position[Z_AXIS];
current_position[Z_AXIS]+=-retract_zlift;
destination[E_AXIS]=current_position[E_AXIS]-retract_length;
feedrate=retract_feedrate;
retracted=true;
prepare_move();
}
break; break;
case 11: // G11 retract_recover case 11: // G11 retract_recover
if(retracted) retract(false);
{
destination[X_AXIS]=current_position[X_AXIS];
destination[Y_AXIS]=current_position[Y_AXIS];
destination[Z_AXIS]=current_position[Z_AXIS];
current_position[Z_AXIS]+=retract_zlift;
destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length;
feedrate=retract_recover_feedrate;
retracted=false;
prepare_move();
}
break; break;
#endif //FWRETRACT #endif //FWRETRACT
case 28: //G28 Home all Axis one at a time case 28: //G28 Home all Axis one at a time
@ -1185,7 +1241,7 @@ void process_commands()
#else // NOT DELTA #else // NOT DELTA
home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))); home_all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])));
#if Z_HOME_DIR > 0 // If homing away from BED do Z first #if Z_HOME_DIR > 0 // If homing away from BED do Z first
if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) { if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
@ -1353,6 +1409,15 @@ void process_commands()
#error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin." #error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
#endif #endif
// Prevent user from running a G29 without first homing in X and Y
if (! (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) )
{
LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN);
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN);
break; // abort G29, since we don't know where we are
}
st_synchronize(); st_synchronize();
// make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
//vector_3 corrected_position = plan_get_position_mm(); //vector_3 corrected_position = plan_get_position_mm();
@ -1407,31 +1472,20 @@ void process_commands()
for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++) for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++)
{ {
float z_before;
if (probePointCounter == 0) if (probePointCounter == 0)
{ {
// raise before probing // raise before probing
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING); z_before = Z_RAISE_BEFORE_PROBING;
} else } else
{ {
// raise extruder // raise extruder
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); z_before = current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS;
} }
float measured_z = probe_pt(xProbe, yProbe, z_before);
do_blocking_move_to(xProbe - X_PROBE_OFFSET_FROM_EXTRUDER, yProbe - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]); eqnBVector[probePointCounter] = measured_z;
engage_z_probe(); // Engage Z Servo endstop if available
run_z_probe();
eqnBVector[probePointCounter] = current_position[Z_AXIS];
retract_z_probe();
SERIAL_PROTOCOLPGM("Bed x: ");
SERIAL_PROTOCOL(xProbe);
SERIAL_PROTOCOLPGM(" y: ");
SERIAL_PROTOCOL(yProbe);
SERIAL_PROTOCOLPGM(" z: ");
SERIAL_PROTOCOL(current_position[Z_AXIS]);
SERIAL_PROTOCOLPGM("\n");
eqnAMatrix[probePointCounter + 0*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = xProbe; eqnAMatrix[probePointCounter + 0*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = xProbe;
eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = yProbe; eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = yProbe;
@ -1461,56 +1515,13 @@ void process_commands()
// prob 1 // prob 1
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING); float z_at_xLeft_yBack = probe_pt(LEFT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, Z_RAISE_BEFORE_PROBING);
do_blocking_move_to(LEFT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, BACK_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
engage_z_probe(); // Engage Z Servo endstop if available
run_z_probe();
float z_at_xLeft_yBack = current_position[Z_AXIS];
retract_z_probe();
SERIAL_PROTOCOLPGM("Bed x: ");
SERIAL_PROTOCOL(LEFT_PROBE_BED_POSITION);
SERIAL_PROTOCOLPGM(" y: ");
SERIAL_PROTOCOL(BACK_PROBE_BED_POSITION);
SERIAL_PROTOCOLPGM(" z: ");
SERIAL_PROTOCOL(current_position[Z_AXIS]);
SERIAL_PROTOCOLPGM("\n");
// prob 2 // prob 2
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); float z_at_xLeft_yFront = probe_pt(LEFT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
do_blocking_move_to(LEFT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, FRONT_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
engage_z_probe(); // Engage Z Servo endstop if available
run_z_probe();
float z_at_xLeft_yFront = current_position[Z_AXIS];
retract_z_probe();
SERIAL_PROTOCOLPGM("Bed x: ");
SERIAL_PROTOCOL(LEFT_PROBE_BED_POSITION);
SERIAL_PROTOCOLPGM(" y: ");
SERIAL_PROTOCOL(FRONT_PROBE_BED_POSITION);
SERIAL_PROTOCOLPGM(" z: ");
SERIAL_PROTOCOL(current_position[Z_AXIS]);
SERIAL_PROTOCOLPGM("\n");
// prob 3 // prob 3
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); float z_at_xRight_yFront = probe_pt(RIGHT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
// the current position will be updated by the blocking move so the head will not lower on this next call.
do_blocking_move_to(RIGHT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, FRONT_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
engage_z_probe(); // Engage Z Servo endstop if available
run_z_probe();
float z_at_xRight_yFront = current_position[Z_AXIS];
retract_z_probe(); // Retract Z Servo endstop if available
SERIAL_PROTOCOLPGM("Bed x: ");
SERIAL_PROTOCOL(RIGHT_PROBE_BED_POSITION);
SERIAL_PROTOCOLPGM(" y: ");
SERIAL_PROTOCOL(FRONT_PROBE_BED_POSITION);
SERIAL_PROTOCOLPGM(" z: ");
SERIAL_PROTOCOL(current_position[Z_AXIS]);
SERIAL_PROTOCOLPGM("\n");
clean_up_after_endstop_move(); clean_up_after_endstop_move();
@ -1545,7 +1556,8 @@ void process_commands()
feedrate = homing_feedrate[Z_AXIS]; feedrate = homing_feedrate[Z_AXIS];
run_z_probe(); run_z_probe();
SERIAL_PROTOCOLPGM("Bed Position X: "); SERIAL_PROTOCOLPGM(MSG_BED);
SERIAL_PROTOCOLPGM(" X: ");
SERIAL_PROTOCOL(current_position[X_AXIS]); SERIAL_PROTOCOL(current_position[X_AXIS]);
SERIAL_PROTOCOLPGM(" Y: "); SERIAL_PROTOCOLPGM(" Y: ");
SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOL(current_position[Y_AXIS]);
@ -2085,7 +2097,7 @@ void process_commands()
} }
else else
{ {
bool all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))|| (code_seen(axis_codes[3]))); bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS]))|| (code_seen(axis_codes[E_AXIS])));
if(all_axis) if(all_axis)
{ {
st_synchronize(); st_synchronize();
@ -3041,42 +3053,6 @@ void get_coordinates()
next_feedrate = code_value(); next_feedrate = code_value();
if(next_feedrate > 0.0) feedrate = next_feedrate; if(next_feedrate > 0.0) feedrate = next_feedrate;
} }
#ifdef FWRETRACT
if(autoretract_enabled)
if( !(seen[X_AXIS] || seen[Y_AXIS] || seen[Z_AXIS]) && seen[E_AXIS])
{
float echange=destination[E_AXIS]-current_position[E_AXIS];
if(echange<-MIN_RETRACT) //retract
{
if(!retracted)
{
destination[Z_AXIS]+=retract_zlift; //not sure why chaninging current_position negatively does not work.
//if slicer retracted by echange=-1mm and you want to retract 3mm, corrrectede=-2mm additionally
float correctede=-echange-retract_length;
//to generate the additional steps, not the destination is changed, but inversely the current position
current_position[E_AXIS]+=-correctede;
feedrate=retract_feedrate;
retracted=true;
}
}
else
if(echange>MIN_RETRACT) //retract_recover
{
if(retracted)
{
//current_position[Z_AXIS]+=-retract_zlift;
//if slicer retracted_recovered by echange=+1mm and you want to retract_recover 3mm, corrrectede=2mm additionally
float correctede=-echange+1*retract_length+retract_recover_length; //total unretract=retract_length+retract_recover_length[surplus]
current_position[E_AXIS]+=correctede; //to generate the additional steps, not the destination is changed, but inversely the current position
feedrate=retract_recover_feedrate;
retracted=false;
}
}
}
#endif //FWRETRACT
} }
void get_arc_coordinates() void get_arc_coordinates()

View File

@ -22,7 +22,7 @@ CardReader::CardReader()
file_subcall_ctr=0; file_subcall_ctr=0;
memset(workDirParents, 0, sizeof(workDirParents)); memset(workDirParents, 0, sizeof(workDirParents));
autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware. autostart_stilltocheck=true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
lastnr=0; lastnr=0;
//power to SD reader //power to SD reader
#if SDPOWER > -1 #if SDPOWER > -1
@ -245,7 +245,7 @@ void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/)
{ {
if(!cardOK) if(!cardOK)
return; return;
if(file.isOpen()) //replaceing current file by new file, or subfile call if(file.isOpen()) //replacing current file by new file, or subfile call
{ {
if(!replace_current) if(!replace_current)
{ {
@ -544,7 +544,7 @@ void CardReader::closefile(bool store_location)
if(store_location) if(store_location)
{ {
//future: store printer state, filename and position for continueing a stoped print //future: store printer state, filename and position for continuing a stopped print
// so one can unplug the printer and continue printing the next day. // so one can unplug the printer and continue printing the next day.
} }

File diff suppressed because it is too large Load Diff

View File

@ -1381,7 +1381,7 @@
#define SDSS 53 #define SDSS 53
#define LED_PIN 8 #define LED_PIN 8
#define FAN_PIN 7 #define FAN_PIN 7
#define PS_ON_PIN 12 #define PS_ON_PIN -1
#define KILL_PIN -1 #define KILL_PIN -1
#define SUICIDE_PIN -1 //PIN that has to be turned on right after start, to keep power flowing. #define SUICIDE_PIN -1 //PIN that has to be turned on right after start, to keep power flowing.
#define SAFETY_TRIGGERED_PIN 28 //PIN to detect the safety circuit has triggered #define SAFETY_TRIGGERED_PIN 28 //PIN to detect the safety circuit has triggered

View File

@ -857,6 +857,70 @@ const short temptable_60[][2] PROGMEM = {
}; };
#endif #endif
// Pt1000 and Pt100 handling
//
// Rt=R0*(1+a*T+b*T*T) [for T>0]
// a=3.9083E-3, b=-5.775E-7
#define PtA 3.9083E-3
#define PtB -5.775E-7
#define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
#define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
#if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup
const short temptable_110[][2] PROGMEM = {
// only few values are needed as the curve is very flat
PtLine(0,100,1000)
PtLine(50,100,1000)
PtLine(100,100,1000)
PtLine(150,100,1000)
PtLine(200,100,1000)
PtLine(250,100,1000)
PtLine(300,100,1000)
};
#endif
#if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup
const short temptable_147[][2] PROGMEM = {
// only few values are needed as the curve is very flat
PtLine(0,100,4700)
PtLine(50,100,4700)
PtLine(100,100,4700)
PtLine(150,100,4700)
PtLine(200,100,4700)
PtLine(250,100,4700)
PtLine(300,100,4700)
};
#endif
#if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup
const short temptable_1010[][2] PROGMEM = {
PtLine(0,1000,1000)
PtLine(25,1000,1000)
PtLine(50,1000,1000)
PtLine(75,1000,1000)
PtLine(100,1000,1000)
PtLine(125,1000,1000)
PtLine(150,1000,1000)
PtLine(175,1000,1000)
PtLine(200,1000,1000)
PtLine(225,1000,1000)
PtLine(250,1000,1000)
PtLine(275,1000,1000)
PtLine(300,1000,1000)
};
#endif
#if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup
const short temptable_1047[][2] PROGMEM = {
// only few values are needed as the curve is very flat
PtLine(0,1000,4700)
PtLine(50,1000,4700)
PtLine(100,1000,4700)
PtLine(150,1000,4700)
PtLine(200,1000,4700)
PtLine(250,1000,4700)
PtLine(300,1000,4700)
};
#endif
#define _TT_NAME(_N) temptable_ ## _N #define _TT_NAME(_N) temptable_ ## _N
#define TT_NAME(_N) _TT_NAME(_N) #define TT_NAME(_N) _TT_NAME(_N)

View File

@ -460,6 +460,7 @@ static void lcd_move_x()
{ {
if (encoderPosition != 0) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS) if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
current_position[X_AXIS] = X_MIN_POS; current_position[X_AXIS] = X_MIN_POS;
@ -489,6 +490,7 @@ static void lcd_move_y()
{ {
if (encoderPosition != 0) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS) if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
current_position[Y_AXIS] = Y_MIN_POS; current_position[Y_AXIS] = Y_MIN_POS;
@ -518,6 +520,7 @@ static void lcd_move_z()
{ {
if (encoderPosition != 0) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
current_position[Z_AXIS] = Z_MIN_POS; current_position[Z_AXIS] = Z_MIN_POS;
@ -706,7 +709,9 @@ static void lcd_control_motion_menu()
{ {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
#ifdef ENABLE_AUTO_BED_LEVELING
MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50); MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50);
#endif
MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 500, 99000); MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 500, 99000);
MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990); MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990);
MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &max_z_jerk, 0.1, 990); MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &max_z_jerk, 0.1, 990);

View File

@ -718,6 +718,7 @@ static void lcd_implementation_quick_feedback()
#endif #endif
#elif defined(BEEPER) && BEEPER > -1 #elif defined(BEEPER) && BEEPER > -1
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
for(int8_t i=0;i<10;i++) for(int8_t i=0;i<10;i++)
{ {
WRITE(BEEPER,HIGH); WRITE(BEEPER,HIGH);
@ -725,6 +726,15 @@ static void lcd_implementation_quick_feedback()
WRITE(BEEPER,LOW); WRITE(BEEPER,LOW);
delayMicroseconds(100); delayMicroseconds(100);
} }
#else
for(int8_t i=0;i<(LCD_FEEDBACK_FREQUENCY_DURATION_MS / (1000 / LCD_FEEDBACK_FREQUENCY_HZ));i++)
{
WRITE(BEEPER,HIGH);
delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2);
WRITE(BEEPER,LOW);
delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2);
}
#endif
#endif #endif
} }

View File

@ -12,8 +12,8 @@
#define ST7920_DAT_PIN LCD_PINS_ENABLE #define ST7920_DAT_PIN LCD_PINS_ENABLE
#define ST7920_CS_PIN LCD_PINS_RS #define ST7920_CS_PIN LCD_PINS_RS
//#define PAGE_HEIGHT 8 //128 byte frambuffer //#define PAGE_HEIGHT 8 //128 byte framebuffer
//#define PAGE_HEIGHT 16 //256 byte frambuffer //#define PAGE_HEIGHT 16 //256 byte framebuffer
#define PAGE_HEIGHT 32 //512 byte framebuffer #define PAGE_HEIGHT 32 //512 byte framebuffer
#define WIDTH 128 #define WIDTH 128
@ -59,8 +59,8 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
ST7920_SET_CMD(); ST7920_SET_CMD();
ST7920_WRITE_BYTE(0x08); //display off, cursor+blink off ST7920_WRITE_BYTE(0x08); //display off, cursor+blink off
ST7920_WRITE_BYTE(0x01); //clear CGRAM ram ST7920_WRITE_BYTE(0x01); //clear CGRAM ram
u8g_Delay(10); //delay for cgram clear u8g_Delay(10); //delay for CGRAM clear
ST7920_WRITE_BYTE(0x3E); //extended mode + gdram active ST7920_WRITE_BYTE(0x3E); //extended mode + GDRAM active
for(y=0;y<HEIGHT/2;y++) //clear GDRAM for(y=0;y<HEIGHT/2;y++) //clear GDRAM
{ {
ST7920_WRITE_BYTE(0x80|y); //set y ST7920_WRITE_BYTE(0x80|y); //set y

View File

@ -22,19 +22,9 @@
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
#include "vector_3.h" #include "vector_3.h"
vector_3::vector_3() vector_3::vector_3() : x(0), y(0), z(0) { }
{
this->x = 0;
this->y = 0;
this->z = 0;
}
vector_3::vector_3(float x, float y, float z) vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { }
{
this->x = x;
this->y = y;
this->z = z;
}
vector_3 vector_3::cross(vector_3 left, vector_3 right) vector_3 vector_3::cross(vector_3 left, vector_3 right)
{ {

View File

@ -4,9 +4,9 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef USE_WATCHDOG #ifdef USE_WATCHDOG
// intialise watch dog with a 1 sec interrupt time // initialize watch dog with a 1 sec interrupt time
void watchdog_init(); void watchdog_init();
// pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or avr will go into emergency procedures.. // pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or AVR will go into emergency procedures..
void watchdog_reset(); void watchdog_reset();
#else #else
//If we do not have a watchdog, then we can have empty functions which are optimized away. //If we do not have a watchdog, then we can have empty functions which are optimized away.