Commit c6aa7755 authored by MagoKimbra's avatar MagoKimbra

Update

parent 8747ae9e
...@@ -217,23 +217,24 @@ ...@@ -217,23 +217,24 @@
// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning // PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
// Comment the following line to disable PID and enable bang-bang. // Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP #define PIDTEMP
#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #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 PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
//#define PID_DEBUG // Sends debug data to the serial port. #ifdef PIDTEMP
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define PID_DEBUG // Sends debug data to the serial port.
//#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_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
// If the temperature difference between the target temperature and the actual temperature //#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
// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // If the temperature difference between the target temperature and the actual temperature
#define PID_FUNCTIONAL_RANGE 10 // degC // 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 PID_FUNCTIONAL_RANGE 10 // degC
#define K1 0.95 // Smoothing factor within the PID #define PID_INTEGRAL_DRIVE_MAX PID_MAX // Limit for the integral term
#define MAX_OVERSHOOT_PID_AUTOTUNE 20 // Max valor for overshoot autotune #define K1 0.95 // Smoothing factor within the PID
#define MAX_OVERSHOOT_PID_AUTOTUNE 20 // Max valor for overshoot autotune
// HotEnd{HE0,HE1,HE2,HE3}
#define DEFAULT_Kp {40, 40, 40, 40} // Kp for E0, E1, E2, E3 // HotEnd{HE0,HE1,HE2,HE3}
#define DEFAULT_Ki {07, 07, 07, 07} // Ki for E0, E1, E2, E3 #define DEFAULT_Kp {40, 40, 40, 40} // Kp for E0, E1, E2, E3
#define DEFAULT_Kd {60, 60, 60, 60} // Kd for E0, E1, E2, E3 #define DEFAULT_Ki {07, 07, 07, 07} // Ki for E0, E1, E2, E3
#define DEFAULT_Kd {60, 60, 60, 60} // Kd for E0, E1, E2, E3
#endif // PIDTEMP
//=========================================================================== //===========================================================================
...@@ -260,12 +261,14 @@ ...@@ -260,12 +261,14 @@
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
//#define PID_BED_DEBUG // Sends debug data to the serial port. //#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER // limit for the integral term
#ifdef PIDTEMPBED
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER // limit for the integral term
//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00 #define DEFAULT_bedKp 10.00
#define DEFAULT_bedKi .023 #define DEFAULT_bedKi .023
#define DEFAULT_bedKd 305.4 #define DEFAULT_bedKd 305.4
//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from pidautotune //from pidautotune
...@@ -274,6 +277,7 @@ ...@@ -274,6 +277,7 @@
// #define DEFAULT_bedKd 1675.16 // #define DEFAULT_bedKd 1675.16
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#endif // PIDTEMPBED
//=========================================================================== //===========================================================================
...@@ -330,7 +334,12 @@ ...@@ -330,7 +334,12 @@
//#define ULTIPANEL //the UltiPanel as on Thingiverse //#define ULTIPANEL //the UltiPanel as on Thingiverse
//#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
//#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
// 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms> // 0 to disable buzzer feedback
// Original RADDS Display from Willy
// http://max3dshop.org/index.php/default/elektronik/radds-lcd-sd-display-with-reset-and-back-buttom.html
//#define RADDS_DISPLAY
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne // http://reprap.org/wiki/PanelOne
//#define PANEL_ONE //#define PANEL_ONE
...@@ -347,8 +356,10 @@ ...@@ -347,8 +356,10 @@
// This is a new controller currently under development. // This is a new controller currently under development.
// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ // https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/
//
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib // ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define ELB_FULL_GRAPHIC_CONTROLLER //#define ELB_FULL_GRAPHIC_CONTROLLER
//#define SDCARDDETECTINVERTED
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
......
...@@ -106,6 +106,11 @@ ...@@ -106,6 +106,11 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100 //#define FAN_KICKSTART_TIME 100
// This defines the minimal speed for the main fan, run in PWM mode
// to enable uncomment and set minimal PWM speed for reliable running (1-255)
// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM
//#define FAN_MIN_PWM 50
// Extruder cooling fans // Extruder cooling fans
// Configure fan pin outputs to automatically turn on/off when the associated // Configure fan pin outputs to automatically turn on/off when the associated
// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
...@@ -230,8 +235,8 @@ ...@@ -230,8 +235,8 @@
// Default stepper release if idle. Set to 0 to deactivate. // Default stepper release if idle. Set to 0 to deactivate.
#define DEFAULT_STEPPER_DEACTIVE_TIME 60 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
// Default step delay for any driver // Uncomment it if you have High speed stepping driver
//#define STEPPER_HIGH_LOW_DELAY 1 // Delay in microseconds #define ENABLE_HIGH_SPEED_STEPPING
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
...@@ -292,7 +297,9 @@ ...@@ -292,7 +297,9 @@
// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT // 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 // 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 // be commented out otherwise
#define SDCARDDETECTINVERTED #ifndef ELB_FULL_GRAPHIC_CONTROLLER
#define SDCARDDETECTINVERTED
#endif
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? #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. #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
...@@ -368,7 +375,7 @@ ...@@ -368,7 +375,7 @@
#define EXTRUDER_ADVANCE_K .0 #define EXTRUDER_ADVANCE_K .0
#define D_FILAMENT 2.85 #define D_FILAMENT 2.85
#define STEPS_MM_E 836 #define STEPS_MM_E 836
#endif // ADVANCE #endif
// Arc interpretation settings: // Arc interpretation settings:
#define MM_PER_ARC_SEGMENT 1 #define MM_PER_ARC_SEGMENT 1
...@@ -400,10 +407,10 @@ const unsigned int dropsegments = 5; // everything with less than this number of ...@@ -400,10 +407,10 @@ const unsigned int dropsegments = 5; // everything with less than this number of
// Therefore some clients abort after 30 seconds in a timeout. // Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'. // Some other clients start sending commands while receiving a 'wait'.
// This "wait" is only sent when the buffer is empty. 1 second is a good value here. // This "wait" is only sent when the buffer is empty. 1 second is a good value here.
#define NO_TIMEOUTS 1000 // Milliseconds //#define NO_TIMEOUTS 1000 // Milliseconds
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK //#define ADVANCED_OK
// Firmware based and LCD controlled 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.
......
...@@ -226,7 +226,7 @@ extern float homing_feedrate[]; ...@@ -226,7 +226,7 @@ extern float homing_feedrate[];
extern bool axis_relative_modes[]; extern bool axis_relative_modes[];
extern int feedrate_multiplier; extern int feedrate_multiplier;
extern bool volumetric_enabled; extern bool volumetric_enabled;
extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
extern float current_position[NUM_AXIS]; extern float current_position[NUM_AXIS];
......
...@@ -251,7 +251,7 @@ float homing_feedrate[] = HOMING_FEEDRATE; ...@@ -251,7 +251,7 @@ float homing_feedrate[] = HOMING_FEEDRATE;
bool axis_relative_modes[] = AXIS_RELATIVE_MODES; bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
int feedrate_multiplier = 100; //100->1 200->2 int feedrate_multiplier = 100; //100->1 200->2
int saved_feedrate_multiplier; int saved_feedrate_multiplier;
int extruder_multiply[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100); int extruder_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS(100, 100, 100, 100);
bool volumetric_enabled = false; bool volumetric_enabled = false;
float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA); float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA, DEFAULT_NOMINAL_FILAMENT_DIA);
float volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS(1.0, 1.0, 1.0, 1.0); float volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS(1.0, 1.0, 1.0, 1.0);
...@@ -4941,10 +4941,10 @@ inline void gcode_M221() { ...@@ -4941,10 +4941,10 @@ inline void gcode_M221() {
int sval = code_value(); int sval = code_value();
if (code_seen('T')) { if (code_seen('T')) {
if (setTargetedHotend(221)) return; if (setTargetedHotend(221)) return;
extruder_multiply[target_extruder] = sval; extruder_multiplier[target_extruder] = sval;
} }
else { else {
extruder_multiply[active_extruder] = sval; extruder_multiplier[active_extruder] = sval;
} }
} }
} }
...@@ -5134,9 +5134,6 @@ inline void gcode_M303() { ...@@ -5134,9 +5134,6 @@ inline void gcode_M303() {
int c = code_seen('C') ? code_value_short() : 5; int c = code_seen('C') ? code_value_short() : 5;
float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0); float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0);
PID_autotune(temp, e, c); PID_autotune(temp, e, c);
// Suppress a line mismatch error
gcode_LastN += 1;
FlushSerialRequestResend();
} }
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
...@@ -5372,7 +5369,7 @@ inline void gcode_M400() { st_synchronize(); } ...@@ -5372,7 +5369,7 @@ inline void gcode_M400() { st_synchronize(); }
filament_sensor = true; filament_sensor = true;
//ECHO_SMV(DB, "Filament dia (measured mm):", filament_width_meas); //ECHO_SMV(DB, "Filament dia (measured mm):", filament_width_meas);
//ECHO_EMV("Extrusion ratio(%):", extruder_multiply[active_extruder]); //ECHO_EMV("Extrusion ratio(%):", extruder_multiplier[active_extruder]);
} }
/** /**
...@@ -5506,50 +5503,50 @@ inline void gcode_M503() { ...@@ -5506,50 +5503,50 @@ inline void gcode_M503() {
* *
*/ */
inline void gcode_M600() { inline void gcode_M600() {
float fr60 = feedrate / 60; float target[NUM_AXIS], fr60 = feedrate / 60;
filament_changing = true; filament_changing = true;
for (int i = 0; i < NUM_AXIS; i++) for (int i = 0; i < NUM_AXIS; i++)
lastpos[i] = destination[i] = current_position[i]; target[i] = lastpos[i] = current_position[i];
#ifdef DELTA #ifdef DELTA
#define RUNPLAN calculate_delta(destination); \ #define RUNPLAN calculate_delta(target); \
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], fr60, active_extruder, active_driver); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], fr60, active_extruder, active_driver);
#else #else
#define RUNPLAN line_to_destination(); #define RUNPLAN plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], fr60, active_extruder, active_driver);
#endif #endif
//retract by E //retract by E
if (code_seen('E')) destination[E_AXIS] += code_value(); if (code_seen('E')) target[E_AXIS] += code_value();
#ifdef FILAMENTCHANGE_FIRSTRETRACT #ifdef FILAMENTCHANGE_FIRSTRETRACT
else destination[E_AXIS] += FILAMENTCHANGE_FIRSTRETRACT; else target[E_AXIS] += FILAMENTCHANGE_FIRSTRETRACT;
#endif #endif
RUNPLAN; RUNPLAN;
//lift Z //lift Z
if (code_seen('Z')) destination[Z_AXIS] += code_value(); if (code_seen('Z')) target[Z_AXIS] += code_value();
#ifdef FILAMENTCHANGE_ZADD #ifdef FILAMENTCHANGE_ZADD
else destination[Z_AXIS] += FILAMENTCHANGE_ZADD; else target[Z_AXIS] += FILAMENTCHANGE_ZADD;
#endif #endif
RUNPLAN; RUNPLAN;
//move xy //move xy
if (code_seen('X')) destination[X_AXIS] = code_value(); if (code_seen('X')) target[X_AXIS] = code_value();
#ifdef FILAMENTCHANGE_XPOS #ifdef FILAMENTCHANGE_XPOS
else destination[X_AXIS] = FILAMENTCHANGE_XPOS; else target[X_AXIS] = FILAMENTCHANGE_XPOS;
#endif #endif
if (code_seen('Y')) destination[Y_AXIS] = code_value(); if (code_seen('Y')) target[Y_AXIS] = code_value();
#ifdef FILAMENTCHANGE_YPOS #ifdef FILAMENTCHANGE_YPOS
else destination[Y_AXIS] = FILAMENTCHANGE_YPOS; else target[Y_AXIS] = FILAMENTCHANGE_YPOS;
#endif #endif
RUNPLAN; RUNPLAN;
if (code_seen('L')) destination[E_AXIS] += code_value(); if (code_seen('L')) target[E_AXIS] += code_value();
#ifdef FILAMENTCHANGE_FINALRETRACT #ifdef FILAMENTCHANGE_FINALRETRACT
else destination[E_AXIS] += FILAMENTCHANGE_FINALRETRACT; else target[E_AXIS] += FILAMENTCHANGE_FINALRETRACT;
#endif #endif
RUNPLAN; RUNPLAN;
...@@ -5610,12 +5607,12 @@ inline void gcode_M503() { ...@@ -5610,12 +5607,12 @@ inline void gcode_M503() {
} }
//return to normal //return to normal
if (code_seen('L')) destination[E_AXIS] -= code_value(); if (code_seen('L')) target[E_AXIS] -= code_value();
#ifdef FILAMENTCHANGE_FINALRETRACT #ifdef FILAMENTCHANGE_FINALRETRACT
else destination[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT; else target[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT;
#endif #endif
current_position[E_AXIS] = destination[E_AXIS]; //the long retract of L is compensated by manual filament feeding current_position[E_AXIS] = target[E_AXIS]; //the long retract of L is compensated by manual filament feeding
plan_set_e_position(current_position[E_AXIS]); plan_set_e_position(current_position[E_AXIS]);
RUNPLAN; // should do nothing RUNPLAN; // should do nothing
...@@ -5624,17 +5621,12 @@ inline void gcode_M503() { ...@@ -5624,17 +5621,12 @@ inline void gcode_M503() {
#ifdef DELTA #ifdef DELTA
calculate_delta(lastpos); calculate_delta(lastpos);
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], fr60, active_extruder, active_driver); //move xyz back plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], fr60, active_extruder, active_driver); //move xyz back
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], fr60, active_extruder, active_driver); //final unretract plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], fr60, active_extruder, active_driver); //final unretract
#else #else
// Move XY to starting position, then Z, then E plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], target[Z_AXIS], target[E_AXIS], fr60, active_extruder, active_driver); //move xy back
destination[X_AXIS] = lastpos[X_AXIS]; plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], target[E_AXIS], fr60, active_extruder, active_driver); //move z back
destination[Y_AXIS] = lastpos[Y_AXIS]; plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], lastpos[E_AXIS], fr60, active_extruder, active_driver); //final untretract
line_to_destination();
destination[Z_AXIS] = lastpos[Z_AXIS];
line_to_destination();
destination[E_AXIS] = lastpos[E_AXIS];
line_to_destination();
#endif #endif
#if HAS_FILRUNOUT #if HAS_FILRUNOUT
...@@ -6115,11 +6107,12 @@ void process_next_command() { ...@@ -6115,11 +6107,12 @@ void process_next_command() {
// Sanitize the current command: // Sanitize the current command:
// - Skip leading spaces // - Skip leading spaces
// - Bypass N... // - Bypass N[0-9][0-9]*[ ]*
// - Overwrite * with nul to mark the end // - Overwrite * with nul to mark the end
while (*current_command == ' ') ++current_command; while (*current_command == ' ') ++current_command;
if (*current_command == 'N' && current_command[1] >= '0' && current_command[1] <= '9') { if (*current_command == 'N' && current_command[1] >= '0' && current_command[1] <= '9') {
while (*current_command != ' ' && *current_command != 'G' && *current_command != 'M' && *current_command != 'T') ++current_command; current_command += 2; // skip N[0-9]
while (*current_command >= '0' && *current_command <= '9') ++current_command; // skip [0-9]*
while (*current_command == ' ') ++current_command; while (*current_command == ' ') ++current_command;
} }
char *starpos = strchr(current_command, '*'); // * should always be the last parameter char *starpos = strchr(current_command, '*'); // * should always be the last parameter
......
...@@ -311,7 +311,8 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -311,7 +311,8 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
subdirname[dirname_end - dirname_start] = 0; subdirname[dirname_end - dirname_start] = 0;
ECHO_EV(subdirname); ECHO_EV(subdirname);
if (!myDir.open(curDir, subdirname, O_READ)) { if (!myDir.open(curDir, subdirname, O_READ)) {
ECHO_LMV(ER, MSG_SD_OPEN_FILE_FAIL, subdirname); ECHO_MV(MSG_SD_OPEN_FILE_FAIL, subdirname);
ECHO_C('.');
return; return;
} }
else { else {
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#define DEFAULT_LCD_CONTRAST 40 #define DEFAULT_LCD_CONTRAST 40
#elif defined(ELB_FULL_GRAPHIC_CONTROLLER) #elif defined(ELB_FULL_GRAPHIC_CONTROLLER)
#define DEFAULT_LCD_CONTRAST 110 #define DEFAULT_LCD_CONTRAST 110
#define SDCARDDETECTINVERTED
#define SDSLOW
#define U8GLIB_LM6059_AF #define U8GLIB_LM6059_AF
#endif #endif
...@@ -62,7 +60,6 @@ ...@@ -62,7 +60,6 @@
#ifdef RADDS_DISPLAY #ifdef RADDS_DISPLAY
#define ENCODER_PULSES_PER_STEP 2 #define ENCODER_PULSES_PER_STEP 2
#define ENCODER_STEPS_PER_MENU_ITEM 1 #define ENCODER_STEPS_PER_MENU_ITEM 1
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL #define NEWPANEL
#endif #endif
...@@ -103,11 +100,11 @@ ...@@ -103,11 +100,11 @@
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
#if !defined(ENCODER_PULSES_PER_STEP) #ifndef ENCODER_PULSES_PER_STEP
#define ENCODER_PULSES_PER_STEP 4 #define ENCODER_PULSES_PER_STEP 4
#endif #endif
#if !defined(ENCODER_STEPS_PER_MENU_ITEM) #ifndef ENCODER_STEPS_PER_MENU_ITEM
#define ENCODER_STEPS_PER_MENU_ITEM 1 #define ENCODER_STEPS_PER_MENU_ITEM 1
#endif #endif
...@@ -221,7 +218,7 @@ ...@@ -221,7 +218,7 @@
/** /**
* SPLASH_SCREEN_DURATION for no DOGLCD display * SPLASH_SCREEN_DURATION for no DOGLCD display
*/ */
#if !defined(DOGLCD) #ifndef DOGLCD
#undef SPLASH_SCREEN_DURATION #undef SPLASH_SCREEN_DURATION
#define SPLASH_SCREEN_DURATION 500 #define SPLASH_SCREEN_DURATION 500
#endif #endif
...@@ -417,7 +414,7 @@ ...@@ -417,7 +414,7 @@
*/ */
#ifdef ADVANCE #ifdef ADVANCE
#define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI) #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI)
#define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA) #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS + active_extruder] / EXTRUSION_AREA)
#endif #endif
#ifdef ULTIPANEL #ifdef ULTIPANEL
......
...@@ -116,6 +116,8 @@ ...@@ -116,6 +116,8 @@
#ifdef U8GLIB_ST7920 #ifdef U8GLIB_ST7920
//U8GLIB_ST7920_128X64_RRD u8g(0,0,0); //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
U8GLIB_ST7920_128X64_RRD u8g(0); U8GLIB_ST7920_128X64_RRD u8g(0);
#elif defined(U8GLIB_SSD1306)
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST);
#elif defined(MAKRPANEL) #elif defined(MAKRPANEL)
// The MaKrPanel display, ST7565 controller as well // The MaKrPanel display, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
...@@ -194,21 +196,21 @@ static void lcd_implementation_init() { ...@@ -194,21 +196,21 @@ static void lcd_implementation_init() {
#ifdef LCD_PIN_BL // Enable LCD backlight #ifdef LCD_PIN_BL // Enable LCD backlight
pinMode(LCD_PIN_BL, OUTPUT); pinMode(LCD_PIN_BL, OUTPUT);
digitalWrite(LCD_PIN_BL, HIGH); digitalWrite(LCD_PIN_BL, HIGH);
#endif #endif
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);
// FIXME: remove this workaround // FIXME: remove this workaround
// Uncomment this if you have the first generation (V1.10) of STBs board // Uncomment this if you have the first generation (V1.10) of STBs board
// pinMode(17, OUTPUT); // Enable LCD backlight // pinMode(17, OUTPUT); // Enable LCD backlight
// digitalWrite(17, HIGH); // digitalWrite(17, HIGH);
#ifdef LCD_SCREEN_ROT_90 #ifdef LCD_SCREEN_ROT_90
u8g.setRot90(); // Rotate screen by 90° u8g.setRot90(); // Rotate screen by 90°
#elif defined(LCD_SCREEN_ROT_180) #elif defined(LCD_SCREEN_ROT_180)
u8g.setRot180(); // Rotate screen by 180° u8g.setRot180(); // Rotate screen by 180°
#elif defined(LCD_SCREEN_ROT_270) #elif defined(LCD_SCREEN_ROT_270)
u8g.setRot270(); // Rotate screen by 270° u8g.setRot270(); // Rotate screen by 270°
#endif #endif
// Show splashscreen // Show splashscreen
...@@ -221,7 +223,7 @@ static void lcd_implementation_init() { ...@@ -221,7 +223,7 @@ static void lcd_implementation_init() {
int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1)*DOG_CHAR_WIDTH) / 2; int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1)*DOG_CHAR_WIDTH) / 2;
u8g.firstPage(); u8g.firstPage();
do { do {
if (show_splashscreen) { if (show_splashscreen) {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
......
...@@ -442,12 +442,17 @@ void check_axes_activity() { ...@@ -442,12 +442,17 @@ void check_axes_activity() {
} else { } else {
fan_kick_end = 0; fan_kick_end = 0;
} }
#endif//FAN_KICKSTART_TIME #endif //FAN_KICKSTART_TIME
#ifdef FAN_MIN_PWM
#define CALC_FAN_SPEED (tail_fan_speed ? ( FAN_MIN_PWM + (tail_fan_speed * (255 - FAN_MIN_PWM)) / 255 ) : 0)
#else
#define CALC_FAN_SPEED tail_fan_speed
#endif // FAN_MIN_PWM
#ifdef FAN_SOFT_PWM #ifdef FAN_SOFT_PWM
fanSpeedSoftPwm = tail_fan_speed; fanSpeedSoftPwm = CALC_FAN_SPEED;
#else #else
analogWrite(FAN_PIN, tail_fan_speed); analogWrite(FAN_PIN, CALC_FAN_SPEED);
#endif //!FAN_SOFT_PWM #endif // FAN_SOFT_PWM
#endif // HAS_FAN #endif // HAS_FAN
#ifdef AUTOTEMP #ifdef AUTOTEMP
...@@ -498,7 +503,7 @@ float junction_deviation = 0.1; ...@@ -498,7 +503,7 @@ float junction_deviation = 0.1;
target[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]); target[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]);
target[Y_AXIS] = lround(y * axis_steps_per_unit[Y_AXIS]); target[Y_AXIS] = lround(y * axis_steps_per_unit[Y_AXIS]);
target[Z_AXIS] = lround(z * axis_steps_per_unit[Z_AXIS]); target[Z_AXIS] = lround(z * axis_steps_per_unit[Z_AXIS]);
target[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS + active_extruder]); target[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS + extruder]);
float dx = target[X_AXIS] - position[X_AXIS], float dx = target[X_AXIS] - position[X_AXIS],
dy = target[Y_AXIS] - position[Y_AXIS], dy = target[Y_AXIS] - position[Y_AXIS],
...@@ -556,7 +561,7 @@ float junction_deviation = 0.1; ...@@ -556,7 +561,7 @@ float junction_deviation = 0.1;
block->steps[Z_AXIS] = labs(dz); block->steps[Z_AXIS] = labs(dz);
block->steps[E_AXIS] = labs(de); block->steps[E_AXIS] = labs(de);
block->steps[E_AXIS] *= volumetric_multiplier[extruder]; block->steps[E_AXIS] *= volumetric_multiplier[extruder];
block->steps[E_AXIS] *= extruder_multiply[extruder]; block->steps[E_AXIS] *= extruder_multiplier[extruder];
block->steps[E_AXIS] /= 100; block->steps[E_AXIS] /= 100;
block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS]))); block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS])));
...@@ -714,7 +719,7 @@ float junction_deviation = 0.1; ...@@ -714,7 +719,7 @@ float junction_deviation = 0.1;
delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
#endif #endif
delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS + extruder]) * volumetric_multiplier[extruder] * extruder_multiply[extruder] / 100.0; delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS + extruder]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0;
if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
block->millimeters = fabs(delta_mm[E_AXIS]); block->millimeters = fabs(delta_mm[E_AXIS]);
......
...@@ -77,10 +77,11 @@ volatile long endstops_stepsTotal, endstops_stepsDone; ...@@ -77,10 +77,11 @@ volatile long endstops_stepsTotal, endstops_stepsDone;
static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROBE as BIT value static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROBE as BIT value
#ifndef Z_DUAL_ENDSTOPS #ifndef Z_DUAL_ENDSTOPS
static byte old_endstop_bits = 0; // use X_MIN, X_MAX... Z_MAX, Z_PROBE, Z2_MIN, Z2_MAX static byte
#else #else
static uint16_t old_endstop_bits = 0; // use X_MIN, X_MAX... Z_MAX, Z_PROBE, Z2_MIN, Z2_MAX static uint16_t
#endif #endif
old_endstop_bits = 0; // use X_MIN, X_MAX... Z_MAX, Z_PROBE, Z2_MIN, Z2_MAX
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
bool abort_on_endstop_hit = false; bool abort_on_endstop_hit = false;
...@@ -315,15 +316,18 @@ FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) { ...@@ -315,15 +316,18 @@ FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
unsigned short timer; unsigned short timer;
if (step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; if (step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY;
if (step_rate > 20000) { // If steprate > 20kHz >> step 4 times #ifdef ENABLE_HIGH_SPEED_STEPPING
step_rate = (step_rate >> 2) & 0x3fff; if (step_rate > 20000) { // If steprate > 20kHz >> step 4 times
step_loops = 4; step_rate = (step_rate >> 2) & 0x3fff;
} step_loops = 4;
else if (step_rate > 10000) { // If steprate > 10kHz >> step 2 times }
step_rate = (step_rate >> 1) & 0x7fff; else if (step_rate > 10000) { // If steprate > 10kHz >> step 2 times
step_loops = 2; step_rate = (step_rate >> 1) & 0x7fff;
} step_loops = 2;
else { }
else
#endif
{
step_loops = 1; step_loops = 1;
} }
...@@ -415,11 +419,45 @@ FORCE_INLINE void trapezoid_generator_reset() { ...@@ -415,11 +419,45 @@ FORCE_INLINE void trapezoid_generator_reset() {
OCR1A = acceleration_time; OCR1A = acceleration_time;
} }
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
#define _AXIS(AXIS) AXIS ##_AXIS
#define _ENDSTOP_HIT(AXIS) endstop_hit_bits |= BIT(_ENDSTOP(AXIS, MIN))
#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
// SET_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
#define SET_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
// COPY_BIT: copy the value of COPY_BIT to BIT in bits
#define COPY_BIT(bits, COPY_BIT, BIT) SET_BIT(bits, BIT, TEST(bits, COPY_BIT))
// TEST_ENDSTOP: test the old and the current status of an endstop
#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP) && TEST(old_endstop_bits, ENDSTOP))
#define UPDATE_ENDSTOP(AXIS,MINMAX) \
SET_ENDSTOP_BIT(AXIS, MINMAX); \
if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX)) && (current_block->steps[_AXIS(AXIS)] > 0)) { \
endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]; \
_ENDSTOP_HIT(AXIS); \
step_events_completed = current_block->step_event_count; \
}
#define _COUNTER(axis) counter_## axis
#define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
#define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN
#define STEP_START(axis, AXIS) \
_COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
if (_COUNTER(axis) > 0) { \
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); \
_COUNTER(axis) -= current_block->step_event_count; \
count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; }
#define STEP_END(axis, AXIS) _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0)
// "The Stepper Driver Interrupt" - This timer interrupt is the workhorse. // "The Stepper Driver Interrupt" - This timer interrupt is the workhorse.
// It pops blocks from the block_buffer and executes them by pulsing the stepper pins appropriately. // It pops blocks from the block_buffer and executes them by pulsing the stepper pins appropriately.
ISR(TIMER1_COMPA_vect) { ISR(TIMER1_COMPA_vect) {
if(cleaning_buffer_counter) { if (cleaning_buffer_counter) {
current_block = NULL; current_block = NULL;
plan_discard_current_block(); plan_discard_current_block();
#ifdef SD_FINISHED_RELEASECOMMAND #ifdef SD_FINISHED_RELEASECOMMAND
...@@ -464,31 +502,11 @@ ISR(TIMER1_COMPA_vect) { ...@@ -464,31 +502,11 @@ ISR(TIMER1_COMPA_vect) {
if (check_endstops) { if (check_endstops) {
#ifdef Z_DUAL_ENDSTOPS #ifdef Z_DUAL_ENDSTOPS
uint16_t current_endstop_bits = 0; uint16_t
#else #else
byte current_endstop_bits = 0; byte
#endif #endif
current_endstop_bits;
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
#define _AXIS(AXIS) AXIS ##_AXIS
#define _ENDSTOP_HIT(AXIS) endstop_hit_bits |= BIT(_ENDSTOP(AXIS, MIN))
#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
// SET_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
#define SET_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
// COPY_BIT: copy the value of COPY_BIT to BIT in bits
#define COPY_BIT(bits, COPY_BIT, BIT) SET_BIT(bits, BIT, TEST(bits, COPY_BIT))
// TEST_ENDSTOP: test the old and the current status of an endstop
#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP) && TEST(old_endstop_bits, ENDSTOP))
#define UPDATE_ENDSTOP(AXIS,MINMAX) \
SET_ENDSTOP_BIT(AXIS, MINMAX); \
if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX)) && (current_block->steps[_AXIS(AXIS)] > 0)) { \
endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]; \
_ENDSTOP_HIT(AXIS); \
step_events_completed = current_block->step_event_count; \
}
#ifdef COREXY #ifdef COREXY
// Head direction in -X axis for CoreXY bots. // Head direction in -X axis for CoreXY bots.
...@@ -550,7 +568,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -550,7 +568,7 @@ ISR(TIMER1_COMPA_vect) {
#if HAS_Z2_MIN #if HAS_Z2_MIN
SET_ENDSTOP_BIT(Z2, MIN); SET_ENDSTOP_BIT(Z2, MIN);
#else #else
COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN) COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
#endif #endif
byte z_test = TEST_ENDSTOP(Z_MIN) << 0 + TEST_ENDSTOP(Z2_MIN) << 1; // bit 0 for Z, bit 1 for Z2 byte z_test = TEST_ENDSTOP(Z_MIN) << 0 + TEST_ENDSTOP(Z2_MIN) << 1; // bit 0 for Z, bit 1 for Z2
...@@ -608,57 +626,44 @@ ISR(TIMER1_COMPA_vect) { ...@@ -608,57 +626,44 @@ ISR(TIMER1_COMPA_vect) {
old_endstop_bits = current_endstop_bits; old_endstop_bits = current_endstop_bits;
} }
#ifdef ENABLE_HIGH_SPEED_STEPPING
// Take multiple steps per interrupt (For high speed moves)
for (int8_t i = 0; i < step_loops; i++) {
// Take multiple steps per interrupt (For high speed moves) #ifdef ADVANCE
for (int8_t i = 0; i < step_loops; i++) { counter_e += current_block->steps[E_AXIS];
#ifndef AT90USB if (counter_e > 0) {
MSerial.checkRx(); // Check for serial chars. counter_e -= current_block->step_event_count;
#endif e_steps[current_block->active_driver] += TEST(out_bits, E_AXIS) ? -1 : 1;
}
#endif //ADVANCE
#ifdef ADVANCE STEP_START(x,X);
counter_e += current_block->steps[E_AXIS]; STEP_START(y,Y);
if (counter_e > 0) { STEP_START(z,Z);
counter_e -= current_block->step_event_count; #ifndef ADVANCE
e_steps[current_block->active_driver] += TEST(out_bits, E_AXIS) ? -1 : 1; STEP_START(e,E);
} #endif
#endif //ADVANCE
#define _COUNTER(axis) counter_## axis STEP_END(x, X);
#define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP STEP_END(y, Y);
#define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN STEP_END(z, Z);
#ifndef ADVANCE
STEP_END(e, E);
#endif
#define STEP_START(axis, AXIS) \ step_events_completed++;
_COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \ if (step_events_completed >= current_block->step_event_count) break;
if (_COUNTER(axis) > 0) { _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); } }
#else
STEP_START(x,X); STEP_START(x,X);
STEP_START(y,Y); STEP_START(y,Y);
STEP_START(z,Z); STEP_START(z,Z);
#ifndef ADVANCE #ifndef ADVANCE
STEP_START(e,E); STEP_START(e,E);
#endif #endif
#ifdef STEPPER_HIGH_LOW_DELAY
delayMicroseconds(STEPPER_HIGH_LOW_DELAY);
#endif
#define STEP_END(axis, AXIS) \
if (_COUNTER(axis) > 0) { \
_COUNTER(axis) -= current_block->step_event_count; \
count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
}
STEP_END(x, X);
STEP_END(y, Y);
STEP_END(z, Z);
#ifndef ADVANCE
STEP_END(e, E);
#endif
step_events_completed++; step_events_completed++;
if (step_events_completed >= current_block->step_event_count) break; #endif
}
// Calculate new timer value // Calculate new timer value
unsigned short timer; unsigned short timer;
unsigned short step_rate; unsigned short step_rate;
...@@ -687,6 +692,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -687,6 +692,7 @@ ISR(TIMER1_COMPA_vect) {
#endif #endif
} }
else if (step_events_completed > (unsigned long)current_block->decelerate_after) { else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate); MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
if (step_rate > acc_step_rate) { // Check step_rate stays positive if (step_rate > acc_step_rate) { // Check step_rate stays positive
...@@ -719,13 +725,21 @@ ISR(TIMER1_COMPA_vect) { ...@@ -719,13 +725,21 @@ ISR(TIMER1_COMPA_vect) {
// ensure we're running at the correct step rate, even if we just came off an acceleration // ensure we're running at the correct step rate, even if we just came off an acceleration
step_loops = step_loops_nominal; step_loops = step_loops_nominal;
} }
#ifndef ENABLE_HIGH_SPEED_STEPPING
STEP_END(x, X);
STEP_END(y, Y);
STEP_END(z, Z);
#ifndef ADVANCE
STEP_END(e, E);
#endif
#endif
// If current block is finished, reset pointer // If current block is finished, reset pointer
if (step_events_completed >= current_block->step_event_count) { if (step_events_completed >= current_block->step_event_count) {
current_block = NULL; current_block = NULL;
plan_discard_current_block(); plan_discard_current_block();
} }
} } // current_block != NULL
} }
#ifdef ADVANCE #ifdef ADVANCE
......
...@@ -312,13 +312,13 @@ void PID_autotune(float temp, int hotend, int ncycles) { ...@@ -312,13 +312,13 @@ void PID_autotune(float temp, int hotend, int ncycles) {
int p; int p;
if (hotend < 0) { if (hotend < 0) {
p = soft_pwm_bed; p = soft_pwm_bed;
ECHO_SMV(OK, MSG_B, input); ECHO_MV(MSG_B, input);
ECHO_MV(" /", temp, 1); ECHO_MV(" /", temp, 1);
ECHO_EMV(" " MSG_AT, p); ECHO_EMV(" " MSG_AT, p);
} }
else { else {
p = soft_pwm[hotend]; p = soft_pwm[hotend];
ECHO_SMV(OK, MSG_T, input, 1); ECHO_MV(MSG_T, input, 1);
ECHO_MV(" /", temp, 1); ECHO_MV(" /", temp, 1);
ECHO_EMV(" " MSG_AT, p); ECHO_EMV(" " MSG_AT, p);
} }
......
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
#include "planner.h" #include "planner.h"
#include "stepper.h" #include "stepper.h"
// for smoother temperature
#define MEDIAN_COUNT 10
// public functions // public functions
void tp_init(); //initialize the heating void tp_init(); //initialize the heating
void manage_heater(); //it is critical that this is called periodically. void manage_heater(); //it is critical that this is called periodically.
......
...@@ -535,15 +535,15 @@ static void lcd_tune_menu() { ...@@ -535,15 +535,15 @@ static void lcd_tune_menu() {
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP + LCD_MAX_TEMP_OFFSET); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP + LCD_MAX_TEMP_OFFSET);
#endif #endif
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
MENU_ITEM_EDIT(int3, MSG_FLOW " 0", &extruder_multiply[0], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW " 0", &extruder_multiplier[0], 10, 999);
#if TEMP_SENSOR_1 != 0 #if TEMP_SENSOR_1 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW " 1", &extruder_multiply[1], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW " 1", &extruder_multiplier[1], 10, 999);
#endif #endif
#if TEMP_SENSOR_2 != 0 #if TEMP_SENSOR_2 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW " 2", &extruder_multiply[2], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW " 2", &extruder_multiplier[2], 10, 999);
#endif #endif
#if TEMP_SENSOR_3 != 0 #if TEMP_SENSOR_3 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW " 3", &extruder_multiply[3], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW " 3", &extruder_multiplier[3], 10, 999);
#endif #endif
#ifdef BABYSTEPPING #ifdef BABYSTEPPING
......
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