Browse Source

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.
Erik van der Zalm 11 years ago
parent
commit
c4a2077951
4 changed files with 46 additions and 36 deletions
  1. 6
    6
      Marlin/Configuration.h
  2. 0
    6
      Marlin/Configuration_adv.h
  3. 31
    14
      Marlin/Marlin_main.cpp
  4. 9
    10
      README.md

+ 6
- 6
Marlin/Configuration.h View File

259
 
259
 
260
 #ifndef ENDSTOPPULLUPS
260
 #ifndef ENDSTOPPULLUPS
261
   // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
261
   // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
262
-  #define ENDSTOPPULLUP_XMAX
263
-  #define ENDSTOPPULLUP_YMAX
264
-  #define ENDSTOPPULLUP_ZMAX
265
-  #define ENDSTOPPULLUP_XMIN
266
-  #define ENDSTOPPULLUP_YMIN
267
-  //#define ENDSTOPPULLUP_ZMIN
262
+  // #define ENDSTOPPULLUP_XMAX
263
+  // #define ENDSTOPPULLUP_YMAX
264
+  // #define ENDSTOPPULLUP_ZMAX
265
+  // #define ENDSTOPPULLUP_XMIN
266
+  // #define ENDSTOPPULLUP_YMIN
267
+  // #define ENDSTOPPULLUP_ZMIN
268
 #endif
268
 #endif
269
 
269
 
270
 #ifdef ENDSTOPPULLUPS
270
 #ifdef ENDSTOPPULLUPS

+ 0
- 6
Marlin/Configuration_adv.h View File

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

+ 31
- 14
Marlin/Marlin_main.cpp View File

67
 // G91 - Use Relative Coordinates
67
 // G91 - Use Relative Coordinates
68
 // G92 - Set current position to cordinates given
68
 // G92 - Set current position to cordinates given
69
 
69
 
70
-//RepRap M Codes
70
+// M Codes
71
 // M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
71
 // M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
72
 // M1   - Same as M0
72
 // M1   - Same as M0
73
-// M104 - Set extruder target temp
74
-// M105 - Read current temp
75
-// M106 - Fan on
76
-// M107 - Fan off
77
-// M109 - Wait for extruder current temp to reach target temp.
78
-// M114 - Display current position
79
-
80
-//Custom M Codes
81
 // M17  - Enable/Power all stepper motors
73
 // M17  - Enable/Power all stepper motors
82
 // M18  - Disable all stepper motors; same as M84
74
 // M18  - Disable all stepper motors; same as M84
83
 // M20  - List SD card
75
 // M20  - List SD card
101
 //        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
93
 //        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
102
 // M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
94
 // M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
103
 // M92  - Set axis_steps_per_unit - same syntax as G92
95
 // M92  - Set axis_steps_per_unit - same syntax as G92
96
+// M104 - Set extruder target temp
97
+// M105 - Read current temp
98
+// M106 - Fan on
99
+// M107 - Fan off
100
+// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
101
+//        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
104
 // M114 - Output current position to serial port
102
 // M114 - Output current position to serial port
105
 // M115 - Capabilities string
103
 // M115 - Capabilities string
106
 // M117 - display message
104
 // M117 - display message
110
 // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
108
 // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
111
 // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
109
 // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
112
 // M140 - Set bed target temp
110
 // M140 - Set bed target temp
113
-// M190 - Wait for bed current temp to reach target temp.
111
+// M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
112
+//        Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
114
 // M200 - Set filament diameter
113
 // M200 - Set filament diameter
115
 // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
114
 // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
116
 // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
115
 // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
242
   Servo servos[NUM_SERVOS];
241
   Servo servos[NUM_SERVOS];
243
 #endif
242
 #endif
244
 
243
 
244
+bool CooldownNoWait = true;
245
+bool target_direction;
246
+
245
 //===========================================================================
247
 //===========================================================================
246
 //=============================ROUTINES=============================
248
 //=============================ROUTINES=============================
247
 //===========================================================================
249
 //===========================================================================
1161
       #ifdef AUTOTEMP
1163
       #ifdef AUTOTEMP
1162
         autotemp_enabled=false;
1164
         autotemp_enabled=false;
1163
       #endif
1165
       #endif
1164
-      if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
1166
+      if (code_seen('S')) { 
1167
+        setTargetHotend(code_value(), tmp_extruder);
1168
+        CooldownNoWait = true;
1169
+      } else if (code_seen('R')) {
1170
+        setTargetHotend(code_value(), tmp_extruder);
1171
+        CooldownNoWait = false;
1172
+      }
1165
       #ifdef AUTOTEMP
1173
       #ifdef AUTOTEMP
1166
         if (code_seen('S')) autotemp_min=code_value();
1174
         if (code_seen('S')) autotemp_min=code_value();
1167
         if (code_seen('B')) autotemp_max=code_value();
1175
         if (code_seen('B')) autotemp_max=code_value();
1176
       codenum = millis();
1184
       codenum = millis();
1177
 
1185
 
1178
       /* See if we are heating up or cooling down */
1186
       /* See if we are heating up or cooling down */
1179
-      bool target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
1187
+      target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
1180
 
1188
 
1181
       #ifdef TEMP_RESIDENCY_TIME
1189
       #ifdef TEMP_RESIDENCY_TIME
1182
         long residencyStart;
1190
         long residencyStart;
1232
     case 190: // M190 - Wait for bed heater to reach target.
1240
     case 190: // M190 - Wait for bed heater to reach target.
1233
     #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1241
     #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1234
         LCD_MESSAGEPGM(MSG_BED_HEATING);
1242
         LCD_MESSAGEPGM(MSG_BED_HEATING);
1235
-        if (code_seen('S')) setTargetBed(code_value());
1243
+        if (code_seen('S')) { 
1244
+          setTargetBed(code_value());
1245
+          CooldownNoWait = true;
1246
+        } else if (code_seen('R')) {
1247
+          setTargetBed(code_value());
1248
+          CooldownNoWait = false;
1249
+        }
1236
         codenum = millis();
1250
         codenum = millis();
1237
-        while(isHeatingBed())
1251
+        
1252
+        target_direction = isHeatingBed(); // true if heating, false if cooling
1253
+        
1254
+        while ( target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
1238
         {
1255
         {
1239
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
1256
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
1240
           {
1257
           {

+ 9
- 10
README.md View File

142
 *  G91 - Use Relative Coordinates
142
 *  G91 - Use Relative Coordinates
143
 *  G92 - Set current position to cordinates given
143
 *  G92 - Set current position to cordinates given
144
 
144
 
145
-RepRap M Codes
145
+M Codes
146
 *  M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
146
 *  M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
147
 *  M1   - Same as M0
147
 *  M1   - Same as M0
148
-*  M104 - Set extruder target temp
149
-*  M105 - Read current temp
150
-*  M106 - Fan on
151
-*  M107 - Fan off
152
-*  M109 - Wait for extruder current temp to reach target temp.
153
-*  M114 - Display current position
154
-
155
-Custom M Codes
156
 *  M17  - Enable/Power all stepper motors
148
 *  M17  - Enable/Power all stepper motors
157
 *  M18  - Disable all stepper motors; same as M84
149
 *  M18  - Disable all stepper motors; same as M84
158
 *  M20  - List SD card
150
 *  M20  - List SD card
175
 *  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.
167
 *  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.
176
 *  M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
168
 *  M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
177
 *  M92  - Set axis_steps_per_unit - same syntax as G92
169
 *  M92  - Set axis_steps_per_unit - same syntax as G92
170
+*  M104 - Set extruder target temp
171
+*  M105 - Read current temp
172
+*  M106 - Fan on
173
+*  M107 - Fan off
174
+*  M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
175
+*         Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
178
 *  M114 - Output current position to serial port
176
 *  M114 - Output current position to serial port
179
 *  M115 - Capabilities string
177
 *  M115 - Capabilities string
180
 *  M117 - display message
178
 *  M117 - display message
184
 *  M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
182
 *  M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
185
 *  M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
183
 *  M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
186
 *  M140 - Set bed target temp
184
 *  M140 - Set bed target temp
187
-*  M190 - Wait for bed current temp to reach target temp.
185
+*  M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
186
+*         Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
188
 *  M200 - Set filament diameter
187
 *  M200 - Set filament diameter
189
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
188
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
190
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
189
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!

Loading…
Cancel
Save