M109 and M190 now wait when cooling down if R is used instead of S.

M109 S180 waits only when heating.
M109 R180 also waits when cooling.
This commit is contained in:
Erik van der Zalm 2013-07-14 21:10:24 +02:00
parent 8a2a3ef91d
commit c4a2077951
4 changed files with 46 additions and 36 deletions

View file

@ -259,11 +259,11 @@
#ifndef ENDSTOPPULLUPS #ifndef ENDSTOPPULLUPS
// fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined // fine Enstop 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
#define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_YMIN
// #define ENDSTOPPULLUP_ZMIN // #define ENDSTOPPULLUP_ZMIN
#endif #endif

View file

@ -18,12 +18,6 @@
//#define WATCH_TEMP_PERIOD 40000 //40 seconds //#define WATCH_TEMP_PERIOD 40000 //40 seconds
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds //#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
// Wait for Cooldown
// This defines if the M109 call should not block if it is cooling down.
// example: From a current temp of 220, you set M109 S200.
// if CooldownNoWait is defined M109 will not wait for the cooldown to finish
#define CooldownNoWait true
#ifdef PIDTEMP #ifdef PIDTEMP
// this adds an experimental additional term to the heatingpower, proportional to the extrusion speed. // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
// if Kc is choosen well, the additional required power due to increased melting should be compensated. // if Kc is choosen well, the additional required power due to increased melting should be compensated.

View file

@ -67,17 +67,9 @@
// G91 - Use Relative Coordinates // G91 - Use Relative Coordinates
// G92 - Set current position to cordinates given // G92 - Set current position to cordinates given
//RepRap M Codes // M Codes
// M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) // M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
// M1 - Same as M0 // M1 - Same as M0
// M104 - Set extruder target temp
// M105 - Read current temp
// M106 - Fan on
// M107 - Fan off
// M109 - Wait for extruder current temp to reach target temp.
// M114 - Display current position
//Custom M Codes
// M17 - Enable/Power all stepper motors // M17 - Enable/Power all stepper motors
// M18 - Disable all stepper motors; same as M84 // M18 - Disable all stepper motors; same as M84
// M20 - List SD card // M20 - List SD card
@ -101,6 +93,12 @@
// or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. // or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout.
// M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default) // M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
// M92 - Set axis_steps_per_unit - same syntax as G92 // M92 - Set axis_steps_per_unit - same syntax as G92
// M104 - Set extruder target temp
// M105 - Read current temp
// M106 - Fan on
// M107 - Fan off
// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
// Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
// M114 - Output current position to serial port // M114 - Output current position to serial port
// M115 - Capabilities string // M115 - Capabilities string
// M117 - display message // M117 - display message
@ -110,7 +108,8 @@
// M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
// M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
// M140 - Set bed target temp // M140 - Set bed target temp
// M190 - Wait for bed current temp to reach target temp. // M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
// Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
// M200 - Set filament diameter // M200 - Set filament diameter
// M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
// M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
@ -242,6 +241,9 @@ bool Stopped=false;
Servo servos[NUM_SERVOS]; Servo servos[NUM_SERVOS];
#endif #endif
bool CooldownNoWait = true;
bool target_direction;
//=========================================================================== //===========================================================================
//=============================ROUTINES============================= //=============================ROUTINES=============================
//=========================================================================== //===========================================================================
@ -1161,7 +1163,13 @@ void process_commands()
#ifdef AUTOTEMP #ifdef AUTOTEMP
autotemp_enabled=false; autotemp_enabled=false;
#endif #endif
if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder); if (code_seen('S')) {
setTargetHotend(code_value(), tmp_extruder);
CooldownNoWait = true;
} else if (code_seen('R')) {
setTargetHotend(code_value(), tmp_extruder);
CooldownNoWait = false;
}
#ifdef AUTOTEMP #ifdef AUTOTEMP
if (code_seen('S')) autotemp_min=code_value(); if (code_seen('S')) autotemp_min=code_value();
if (code_seen('B')) autotemp_max=code_value(); if (code_seen('B')) autotemp_max=code_value();
@ -1176,7 +1184,7 @@ void process_commands()
codenum = millis(); codenum = millis();
/* See if we are heating up or cooling down */ /* See if we are heating up or cooling down */
bool target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
#ifdef TEMP_RESIDENCY_TIME #ifdef TEMP_RESIDENCY_TIME
long residencyStart; long residencyStart;
@ -1232,9 +1240,18 @@ void process_commands()
case 190: // M190 - Wait for bed heater to reach target. case 190: // M190 - Wait for bed heater to reach target.
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
LCD_MESSAGEPGM(MSG_BED_HEATING); LCD_MESSAGEPGM(MSG_BED_HEATING);
if (code_seen('S')) setTargetBed(code_value()); if (code_seen('S')) {
setTargetBed(code_value());
CooldownNoWait = true;
} else if (code_seen('R')) {
setTargetBed(code_value());
CooldownNoWait = false;
}
codenum = millis(); codenum = millis();
while(isHeatingBed())
target_direction = isHeatingBed(); // true if heating, false if cooling
while ( target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
{ {
if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up. if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
{ {

View file

@ -142,17 +142,9 @@ Implemented G Codes:
* G91 - Use Relative Coordinates * G91 - Use Relative Coordinates
* G92 - Set current position to cordinates given * G92 - Set current position to cordinates given
RepRap M Codes M Codes
* M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
* M1 - Same as M0 * M1 - Same as M0
* M104 - Set extruder target temp
* M105 - Read current temp
* M106 - Fan on
* M107 - Fan off
* M109 - Wait for extruder current temp to reach target temp.
* M114 - Display current position
Custom M Codes
* M17 - Enable/Power all stepper motors * M17 - Enable/Power all stepper motors
* M18 - Disable all stepper motors; same as M84 * M18 - Disable all stepper motors; same as M84
* M20 - List SD card * M20 - List SD card
@ -175,6 +167,12 @@ Custom M Codes
* M84 - Disable steppers until next move, or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. * M84 - Disable steppers until next move, or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout.
* M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default) * M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
* M92 - Set axis_steps_per_unit - same syntax as G92 * M92 - Set axis_steps_per_unit - same syntax as G92
* M104 - Set extruder target temp
* M105 - Read current temp
* M106 - Fan on
* M107 - Fan off
* M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
* Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
* M114 - Output current position to serial port * M114 - Output current position to serial port
* M115 - Capabilities string * M115 - Capabilities string
* M117 - display message * M117 - display message
@ -184,7 +182,8 @@ Custom M Codes
* M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) * M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
* M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) * M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
* M140 - Set bed target temp * M140 - Set bed target temp
* M190 - Wait for bed current temp to reach target temp. * M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
* Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
* M200 - Set filament diameter * M200 - Set filament diameter
* M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) * M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
* M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! * M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!