瀏覽代碼

extruder runout prevention.

Bernhard 13 年之前
父節點
當前提交
1ec0c3b68a
共有 2 個檔案被更改,包括 28 行新增4 行删除
  1. 8
    0
      Marlin/Configuration.h
  2. 20
    4
      Marlin/Marlin.pde

+ 8
- 0
Marlin/Configuration.h 查看文件

156
   #endif
156
   #endif
157
 #endif // PIDTEMP
157
 #endif // PIDTEMP
158
 
158
 
159
+//  extruder run-out prevention. 
160
+//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
161
+//#define EXTRUDER_RUNOUT_PREVENT  
162
+#define EXTRUDER_RUNOUT_MINTEMP 190  
163
+#define EXTRUDER_RUNOUT_SECONDS 60
164
+#define EXTRUDER_RUNOUT_EXTRUDE 10 //mm filament
165
+#define EXTRUDER_RUNOUT_SPEED 20  //extrusion speed
166
+
159
 
167
 
160
 //===========================================================================
168
 //===========================================================================
161
 //=============================Mechanical Settings===========================
169
 //=============================Mechanical Settings===========================

+ 20
- 4
Marlin/Marlin.pde 查看文件

499
     case 1: // G1
499
     case 1: // G1
500
       get_coordinates(); // For X Y Z E F
500
       get_coordinates(); // For X Y Z E F
501
       prepare_move();
501
       prepare_move();
502
-      previous_millis_cmd = millis();
503
       //ClearToSend();
502
       //ClearToSend();
504
       return;
503
       return;
505
       //break;
504
       //break;
506
     case 2: // G2  - CW ARC
505
     case 2: // G2  - CW ARC
507
       get_arc_coordinates();
506
       get_arc_coordinates();
508
       prepare_arc_move(true);
507
       prepare_arc_move(true);
509
-      previous_millis_cmd = millis();
510
       return;
508
       return;
511
     case 3: // G3  - CCW ARC
509
     case 3: // G3  - CCW ARC
512
       get_arc_coordinates();
510
       get_arc_coordinates();
513
       prepare_arc_move(false);
511
       prepare_arc_move(false);
514
-      previous_millis_cmd = millis();
515
       return;
512
       return;
516
     case 4: // G4 dwell
513
     case 4: // G4 dwell
517
       LCD_MESSAGEPGM("DWELL...");
514
       LCD_MESSAGEPGM("DWELL...");
521
       
518
       
522
       st_synchronize();
519
       st_synchronize();
523
       codenum += millis();  // keep track of when we started waiting
520
       codenum += millis();  // keep track of when we started waiting
524
-      
521
+      previous_millis_cmd = millis();
525
       while(millis()  < codenum ){
522
       while(millis()  < codenum ){
526
         manage_heater();
523
         manage_heater();
527
       }
524
       }
837
         }
834
         }
838
         LCD_MESSAGEPGM("Heating done.");
835
         LCD_MESSAGEPGM("Heating done.");
839
         starttime=millis();
836
         starttime=millis();
837
+        previous_millis_cmd = millis();
840
       }
838
       }
841
       break;
839
       break;
842
     case 190: // M190 - Wait bed for heater to reach target.
840
     case 190: // M190 - Wait bed for heater to reach target.
860
           manage_heater();
858
           manage_heater();
861
         }
859
         }
862
         LCD_MESSAGEPGM("Bed done.");
860
         LCD_MESSAGEPGM("Bed done.");
861
+        previous_millis_cmd = millis();
863
     #endif
862
     #endif
864
     break;
863
     break;
865
 
864
 
1149
 
1148
 
1150
 void prepare_move()
1149
 void prepare_move()
1151
 {
1150
 {
1151
+  
1152
   if (min_software_endstops) {
1152
   if (min_software_endstops) {
1153
     if (destination[X_AXIS] < 0) destination[X_AXIS] = 0.0;
1153
     if (destination[X_AXIS] < 0) destination[X_AXIS] = 0.0;
1154
     if (destination[Y_AXIS] < 0) destination[Y_AXIS] = 0.0;
1154
     if (destination[Y_AXIS] < 0) destination[Y_AXIS] = 0.0;
1165
   for(int8_t i=0; i < NUM_AXIS; i++) {
1165
   for(int8_t i=0; i < NUM_AXIS; i++) {
1166
     current_position[i] = destination[i];
1166
     current_position[i] = destination[i];
1167
   }
1167
   }
1168
+  previous_millis_cmd = millis();
1168
 }
1169
 }
1169
 
1170
 
1170
 void prepare_arc_move(char isclockwise) {
1171
 void prepare_arc_move(char isclockwise) {
1179
   for(int8_t i=0; i < NUM_AXIS; i++) {
1180
   for(int8_t i=0; i < NUM_AXIS; i++) {
1180
     current_position[i] = destination[i];
1181
     current_position[i] = destination[i];
1181
   }
1182
   }
1183
+  previous_millis_cmd = millis();
1182
 }
1184
 }
1183
 
1185
 
1184
 void manage_inactivity(byte debug) 
1186
 void manage_inactivity(byte debug) 
1194
       disable_z(); 
1196
       disable_z(); 
1195
       disable_e(); 
1197
       disable_e(); 
1196
     }
1198
     }
1199
+  #ifdef EXTRUDER_RUNOUT_PREVENT
1200
+    if( (millis()-previous_millis_cmd) >  EXTRUDER_RUNOUT_SECONDS*1000 ) 
1201
+    if(degHotend(active_extruder)>EXTRUDER_RUNOUT_MINTEMP)
1202
+    {
1203
+     enable_e();
1204
+     float oldepos=current_position[E_AXIS];
1205
+     float oldedes=destination[E_AXIS];
1206
+     plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]+EXTRUDER_RUNOUT_EXTRUDE, EXTRUDER_RUNOUT_SPEED*feedmultiply/60/100.0, active_extruder);
1207
+     current_position[E_AXIS]=oldepos;
1208
+     destination[E_AXIS]=oldedes;
1209
+     plan_set_e_position(oldepos);
1210
+     previous_millis_cmd=millis();
1211
+    }
1212
+  #endif
1197
   check_axes_activity();
1213
   check_axes_activity();
1198
 }
1214
 }
1199
 
1215
 

Loading…
取消
儲存