瀏覽代碼

Merge pull request #409 from buildrob202/Marlin_v1

Implement automatic cold-end/extruder motor fan control based on nozzle temperature
ErikZalm 12 年之前
父節點
當前提交
b2eeebd9c3
共有 6 個文件被更改,包括 363 次插入285 次删除
  1. 3
    0
      Marlin/Configuration.h
  2. 19
    9
      Marlin/Configuration_adv.h
  3. 23
    36
      Marlin/Marlin_main.cpp
  4. 10
    14
      Marlin/stepper.cpp
  5. 81
    3
      Marlin/temperature.cpp
  6. 227
    223
      README.md

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

51
 #define MOTHERBOARD 7
51
 #define MOTHERBOARD 7
52
 #endif
52
 #endif
53
 
53
 
54
+// This defines the number of extruders
55
+#define EXTRUDERS 1
56
+
54
 //// The following define selects which power supply you have. Please choose the one that matches your setup
57
 //// The following define selects which power supply you have. Please choose the one that matches your setup
55
 // 1 = ATX
58
 // 1 = ATX
56
 // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
59
 // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)

+ 19
- 9
Marlin/Configuration_adv.h 查看文件

63
 //This is for controlling a fan to cool down the stepper drivers
63
 //This is for controlling a fan to cool down the stepper drivers
64
 //it will turn on when any driver is enabled
64
 //it will turn on when any driver is enabled
65
 //and turn off after the set amount of seconds from last driver being disabled again
65
 //and turn off after the set amount of seconds from last driver being disabled again
66
-//#define CONTROLLERFAN_PIN 23 //Pin used for the fan to cool controller, comment out to disable this function
66
+#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
67
-#define CONTROLLERFAN_SEC 60 //How many seconds, after all motors were disabled, the fan should run
67
+#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
68
+#define CONTROLLERFAN_SPEED 255  // == full speed
68
 
69
 
69
 // When first starting the main fan, run it at full speed for the
70
 // When first starting the main fan, run it at full speed for the
70
 // given number of milliseconds.  This gets the fan spinning reliably
71
 // given number of milliseconds.  This gets the fan spinning reliably
71
 // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
72
 // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
72
 //#define FAN_KICKSTART_TIME 100
73
 //#define FAN_KICKSTART_TIME 100
73
 
74
 
75
+// Extruder cooling fans
76
+// Configure fan pin outputs to automatically turn on/off when the associated
77
+// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
78
+// Multiple extruders can be assigned to the same pin in which case 
79
+// the fan will turn on when any selected extruder is above the threshold.
80
+#define EXTRUDER_0_AUTO_FAN_PIN   -1
81
+#define EXTRUDER_1_AUTO_FAN_PIN   -1
82
+#define EXTRUDER_2_AUTO_FAN_PIN   -1
83
+#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
84
+#define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
85
+
86
+
74
 //===========================================================================
87
 //===========================================================================
75
 //=============================Mechanical Settings===========================
88
 //=============================Mechanical Settings===========================
76
 //===========================================================================
89
 //===========================================================================
77
 
90
 
78
-// This defines the number of extruders
79
-#define EXTRUDERS 1
80
-
81
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
82
 
92
 
83
 
93
 
210
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
220
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
211
 //#define WATCHDOG_RESET_MANUAL
221
 //#define WATCHDOG_RESET_MANUAL
212
 #endif
222
 #endif
213
-
223
+
214
-// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
224
+// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
215
-//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
225
+//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
216
 
226
 
217
 // extruder advance constant (s2/mm3)
227
 // extruder advance constant (s2/mm3)
218
 //
228
 //
276
 #else
286
 #else
277
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
287
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
278
 #endif
288
 #endif
279
-
289
+
280
 
290
 
281
 //The ASCII buffer for recieving from the serial:
291
 //The ASCII buffer for recieving from the serial:
282
 #define MAX_CMD_SIZE 96
292
 #define MAX_CMD_SIZE 96

+ 23
- 36
Marlin/Marlin_main.cpp 查看文件

319
 void setup_powerhold()
319
 void setup_powerhold()
320
 {
320
 {
321
  #ifdef SUICIDE_PIN
321
  #ifdef SUICIDE_PIN
322
-   #if (SUICIDE_PIN> -1)
322
+   #if (SUICIDE_PIN> 0)
323
       SET_OUTPUT(SUICIDE_PIN);
323
       SET_OUTPUT(SUICIDE_PIN);
324
       WRITE(SUICIDE_PIN, HIGH);
324
       WRITE(SUICIDE_PIN, HIGH);
325
    #endif
325
    #endif
410
   servo_init();
410
   servo_init();
411
 
411
 
412
   lcd_init();
412
   lcd_init();
413
-
413
+  
414
-  #ifdef CONTROLLERFAN_PIN
414
+  #if CONTROLLERFAN_PIN > 0
415
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
415
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
416
-  #endif
416
+  #endif 
417
-
418
-  #ifdef EXTRUDERFAN_PIN
419
-    SET_OUTPUT(EXTRUDERFAN_PIN); //Set pin used for extruder cooling fan
420
-  #endif
421
 }
417
 }
422
 
418
 
423
 
419
 
1040
             break;
1036
             break;
1041
           }
1037
           }
1042
         }
1038
         }
1039
+      #if FAN_PIN > 0
1040
+        if (pin_number == FAN_PIN)
1041
+          fanSpeed = pin_status;
1042
+      #endif
1043
         if (pin_number > -1)
1043
         if (pin_number > -1)
1044
         {
1044
         {
1045
           pinMode(pin_number, OUTPUT);
1045
           pinMode(pin_number, OUTPUT);
2064
   previous_millis_cmd = millis();
2064
   previous_millis_cmd = millis();
2065
 }
2065
 }
2066
 
2066
 
2067
-#ifdef CONTROLLERFAN_PIN
2067
+#if CONTROLLERFAN_PIN > 0
2068
+
2069
+#if CONTROLLERFAN_PIN == FAN_PIN 
2070
+   #error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN"
2071
+#endif
2072
+
2068
 unsigned long lastMotor = 0; //Save the time for when a motor was turned on last
2073
 unsigned long lastMotor = 0; //Save the time for when a motor was turned on last
2069
 unsigned long lastMotorCheck = 0;
2074
 unsigned long lastMotorCheck = 0;
2070
 
2075
 
2085
     {
2090
     {
2086
       lastMotor = millis(); //... set time to NOW so the fan will turn on
2091
       lastMotor = millis(); //... set time to NOW so the fan will turn on
2087
     }
2092
     }
2088
-
2093
+    
2089
-    if ((millis() - lastMotor) >= (CONTROLLERFAN_SEC*1000UL) || lastMotor == 0) //If the last time any driver was enabled, is longer since than CONTROLLERSEC...
2094
+    if ((millis() - lastMotor) >= (CONTROLLERFAN_SECS*1000UL) || lastMotor == 0) //If the last time any driver was enabled, is longer since than CONTROLLERSEC...   
2090
-    {
2091
-      WRITE(CONTROLLERFAN_PIN, LOW); //... turn the fan off
2092
-    }
2093
-    else
2094
-    {
2095
-      WRITE(CONTROLLERFAN_PIN, HIGH); //... turn the fan on
2096
-    }
2097
-  }
2098
-}
2099
-#endif
2100
-
2101
-#ifdef EXTRUDERFAN_PIN
2102
-unsigned long lastExtruderCheck = 0;
2103
-
2104
-void extruderFan()
2105
-{
2106
-  if ((millis() - lastExtruderCheck) >= 2500) //Not a time critical function, so we only check every 2500ms
2107
-  {
2108
-    lastExtruderCheck = millis();
2109
-
2110
-    if (degHotend(active_extruder) < EXTRUDERFAN_DEC)
2111
     {
2095
     {
2112
-      WRITE(EXTRUDERFAN_PIN, LOW); //... turn the fan off
2096
+        digitalWrite(CONTROLLERFAN_PIN, 0); 
2097
+        analogWrite(CONTROLLERFAN_PIN, 0); 
2113
     }
2098
     }
2114
     else
2099
     else
2115
     {
2100
     {
2116
-      WRITE(EXTRUDERFAN_PIN, HIGH); //... turn the fan on
2101
+        // allows digital or PWM fan output to be used (see M42 handling)
2102
+        digitalWrite(CONTROLLERFAN_PIN, CONTROLLERFAN_SPEED);
2103
+        analogWrite(CONTROLLERFAN_PIN, CONTROLLERFAN_SPEED); 
2117
     }
2104
     }
2118
   }
2105
   }
2119
 }
2106
 }
2137
       }
2124
       }
2138
     }
2125
     }
2139
   }
2126
   }
2140
-  #if( KILL_PIN>-1 )
2127
+  #if KILL_PIN > 0
2141
     if( 0 == READ(KILL_PIN) )
2128
     if( 0 == READ(KILL_PIN) )
2142
       kill();
2129
       kill();
2143
   #endif
2130
   #endif
2144
-  #ifdef CONTROLLERFAN_PIN
2131
+  #if CONTROLLERFAN_PIN > 0
2145
     controllerFan(); //Check if fan should be turned on to cool stepper drivers down
2132
     controllerFan(); //Check if fan should be turned on to cool stepper drivers down
2146
   #endif
2133
   #endif
2147
   #ifdef EXTRUDER_RUNOUT_PREVENT
2134
   #ifdef EXTRUDER_RUNOUT_PREVENT

+ 10
- 14
Marlin/stepper.cpp 查看文件

69
 static volatile bool endstop_x_hit=false;
69
 static volatile bool endstop_x_hit=false;
70
 static volatile bool endstop_y_hit=false;
70
 static volatile bool endstop_y_hit=false;
71
 static volatile bool endstop_z_hit=false;
71
 static volatile bool endstop_z_hit=false;
72
-#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
72
+#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
73
-bool abort_on_endstop_hit = false;
73
+bool abort_on_endstop_hit = false;
74
-#endif
74
+#endif
75
 
75
 
76
 static bool old_x_min_endstop=false;
76
 static bool old_x_min_endstop=false;
77
 static bool old_x_max_endstop=false;
77
 static bool old_x_max_endstop=false;
184
      SERIAL_ECHOPAIR(" Z:",(float)endstops_trigsteps[Z_AXIS]/axis_steps_per_unit[Z_AXIS]);
184
      SERIAL_ECHOPAIR(" Z:",(float)endstops_trigsteps[Z_AXIS]/axis_steps_per_unit[Z_AXIS]);
185
      LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
185
      LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
186
    }
186
    }
187
-   SERIAL_ECHOLN("");
187
+   SERIAL_ECHOLN("");
188
    endstop_x_hit=false;
188
    endstop_x_hit=false;
189
    endstop_y_hit=false;
189
    endstop_y_hit=false;
190
-   endstop_z_hit=false;
190
+   endstop_z_hit=false;
191
-#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
191
+#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
192
-   if (abort_on_endstop_hit)
192
+   if (abort_on_endstop_hit)
193
-   {
193
+   {
194
      card.sdprinting = false;
194
      card.sdprinting = false;
195
      card.closefile();
195
      card.closefile();
196
-     quickStop();
196
+     quickStop();
197
      setTargetHotend0(0);
197
      setTargetHotend0(0);
198
      setTargetHotend1(0);
198
      setTargetHotend1(0);
199
      setTargetHotend2(0);
199
      setTargetHotend2(0);
200
-   }
200
+   }
201
 #endif
201
 #endif
202
  }
202
  }
203
 }
203
 }
879
     disable_e2();
879
     disable_e2();
880
   #endif  
880
   #endif  
881
 
881
 
882
-  #ifdef CONTROLLERFAN_PIN
883
-    SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
884
-  #endif
885
-  
886
   // waveform generation = 0100 = CTC
882
   // waveform generation = 0100 = CTC
887
   TCCR1B &= ~(1<<WGM13);
883
   TCCR1B &= ~(1<<WGM13);
888
   TCCR1B |=  (1<<WGM12);
884
   TCCR1B |=  (1<<WGM12);

+ 81
- 3
Marlin/temperature.cpp 查看文件

99
 #ifdef FAN_SOFT_PWM
99
 #ifdef FAN_SOFT_PWM
100
   static unsigned char soft_pwm_fan;
100
   static unsigned char soft_pwm_fan;
101
 #endif
101
 #endif
102
-
102
+#if EXTRUDER_0_AUTO_FAN_PIN > 0 || EXTRUDER_1_AUTO_FAN_PIN > 0 || EXTRUDER_2_AUTO_FAN_PIN > 0
103
-
103
+  static unsigned long extruder_autofan_last_check;
104
+#endif  
104
   
105
   
105
 #if EXTRUDERS > 3
106
 #if EXTRUDERS > 3
106
 # error Unsupported number of extruders
107
 # error Unsupported number of extruders
306
   return soft_pwm[heater];
307
   return soft_pwm[heater];
307
 }
308
 }
308
 
309
 
310
+#if EXTRUDER_0_AUTO_FAN_PIN > 0 || EXTRUDER_1_AUTO_FAN_PIN > 0 || EXTRUDER_2_AUTO_FAN_PIN > 0
311
+
312
+  #if FAN_PIN > 0
313
+    #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN 
314
+       #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN"
315
+    #endif
316
+    #if EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN 
317
+       #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN"
318
+    #endif
319
+    #if EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN 
320
+       #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN"
321
+    #endif
322
+  #endif 
323
+
324
+void setExtruderAutoFanState(int pin, bool state)
325
+{
326
+  unsigned char newFanSpeed = (state != 0) ? EXTRUDER_AUTO_FAN_SPEED : 0;
327
+  // this idiom allows both digital and PWM fan outputs (see M42 handling).
328
+  pinMode(pin, OUTPUT);
329
+  digitalWrite(pin, newFanSpeed);
330
+  analogWrite(pin, newFanSpeed);
331
+}
332
+
333
+void checkExtruderAutoFans()
334
+{
335
+  uint8_t fanState = 0;
336
+
337
+  // which fan pins need to be turned on?      
338
+  #if EXTRUDER_0_AUTO_FAN_PIN > 0
339
+    if (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE) 
340
+      fanState |= 1;
341
+  #endif
342
+  #if EXTRUDER_1_AUTO_FAN_PIN > 0
343
+    if (current_temperature[1] > EXTRUDER_AUTO_FAN_TEMPERATURE) 
344
+    {
345
+      if (EXTRUDER_1_AUTO_FAN_PIN == EXTRUDER_0_AUTO_FAN_PIN) 
346
+        fanState |= 1;
347
+      else
348
+        fanState |= 2;
349
+    }
350
+  #endif
351
+  #if EXTRUDER_2_AUTO_FAN_PIN > 0
352
+    if (current_temperature[2] > EXTRUDER_AUTO_FAN_TEMPERATURE) 
353
+    {
354
+      if (EXTRUDER_2_AUTO_FAN_PIN == EXTRUDER_0_AUTO_FAN_PIN) 
355
+        fanState |= 1;
356
+      else if (EXTRUDER_2_AUTO_FAN_PIN == EXTRUDER_1_AUTO_FAN_PIN) 
357
+        fanState |= 2;
358
+      else
359
+        fanState |= 4;
360
+    }
361
+  #endif
362
+  
363
+  // update extruder auto fan states
364
+  #if EXTRUDER_0_AUTO_FAN_PIN > 0
365
+    setExtruderAutoFanState(EXTRUDER_0_AUTO_FAN_PIN, (fanState & 1) != 0);
366
+  #endif 
367
+  #if EXTRUDER_1_AUTO_FAN_PIN > 0
368
+    if (EXTRUDER_1_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) 
369
+      setExtruderAutoFanState(EXTRUDER_1_AUTO_FAN_PIN, (fanState & 2) != 0);
370
+  #endif 
371
+  #if EXTRUDER_2_AUTO_FAN_PIN > 0
372
+    if (EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN 
373
+        && EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN)
374
+      setExtruderAutoFanState(EXTRUDER_2_AUTO_FAN_PIN, (fanState & 4) != 0);
375
+  #endif 
376
+}
377
+
378
+#endif // any extruder auto fan pins set
379
+
309
 void manage_heater()
380
 void manage_heater()
310
 {
381
 {
311
   float pid_input;
382
   float pid_input;
398
     #endif
469
     #endif
399
 
470
 
400
   } // End extruder for loop
471
   } // End extruder for loop
401
-  
402
 
472
 
473
+  #if EXTRUDER_0_AUTO_FAN_PIN > 0 || EXTRUDER_1_AUTO_FAN_PIN > 0 || EXTRUDER_2_AUTO_FAN_PIN > 0
474
+  if(millis() - extruder_autofan_last_check > 2500)  // only need to check fan state very infrequently
475
+  {
476
+    checkExtruderAutoFans();
477
+    extruder_autofan_last_check = millis();
478
+  }  
479
+  #endif       
480
+  
403
   #ifndef PIDTEMPBED
481
   #ifndef PIDTEMPBED
404
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
482
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
405
     return;
483
     return;

+ 227
- 223
README.md 查看文件

1
-WARNING: 
1
+==========================
2
---------
2
+Marlin 3D Printer Firmware
3
-THIS IS RELEASE CANDIDATE 2 FOR MARLIN 1.0.0
3
+==========================
4
-
4
+
5
-The configuration is now split in two files
5
+Notes: 
6
-Configuration.h for the normal settings
6
+-----
7
-Configuration_adv.h for the advanced settings
7
+
8
-
8
+The configuration is now split in two files:
9
-Gen7T is not supported.
9
+  Configuration.h for the normal settings
10
-
10
+  Configuration_adv.h for the advanced settings
11
-Quick Information
11
+
12
-===================
12
+Gen7T is not supported.
13
-This RepRap firmware is a mashup between <a href="https://github.com/kliment/Sprinter">Sprinter</a>, <a href="https://github.com/simen/grbl/tree">grbl</a> and many original parts.
13
+
14
-
14
+Quick Information
15
-Derived from Sprinter and Grbl by Erik van der Zalm.
15
+===================
16
-Sprinters lead developers are Kliment and caru.
16
+This RepRap firmware is a mashup between <a href="https://github.com/kliment/Sprinter">Sprinter</a>, <a href="https://github.com/simen/grbl/tree">grbl</a> and many original parts.
17
-Grbls lead developer is Simen Svale Skogsrud. Sonney Jeon (Chamnit) improved some parts of grbl
17
+
18
-A fork by bkubicek for the Ultimaker was merged, and further development was aided by him.
18
+Derived from Sprinter and Grbl by Erik van der Zalm.
19
-Some features have been added by:
19
+Sprinters lead developers are Kliment and caru.
20
-Lampmaker, Bradley Feldman, and others...
20
+Grbls lead developer is Simen Svale Skogsrud. Sonney Jeon (Chamnit) improved some parts of grbl
21
-
21
+A fork by bkubicek for the Ultimaker was merged, and further development was aided by him.
22
-
22
+Some features have been added by:
23
-Features:
23
+Lampmaker, Bradley Feldman, and others...
24
-
24
+
25
-*   Interrupt based movement with real linear acceleration
25
+
26
-*   High steprate
26
+Features:
27
-*   Look ahead (Keep the speed high when possible. High cornering speed)
27
+
28
-*   Interrupt based temperature protection
28
+*   Interrupt based movement with real linear acceleration
29
-*   preliminary support for Matthew Roberts advance algorithm 
29
+*   High steprate
30
-    For more info see: http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
30
+*   Look ahead (Keep the speed high when possible. High cornering speed)
31
-*   Full endstop support
31
+*   Interrupt based temperature protection
32
-*   SD Card support
32
+*   preliminary support for Matthew Roberts advance algorithm 
33
-*   SD Card folders (works in pronterface)
33
+    For more info see: http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
34
-*   SD Card autostart support
34
+*   Full endstop support
35
-*   LCD support (ideally 20x4) 
35
+*   SD Card support
36
-*   LCD menu system for autonomous SD card printing, controlled by an click-encoder. 
36
+*   SD Card folders (works in pronterface)
37
-*   EEPROM storage of e.g. max-velocity, max-acceleration, and similar variables
37
+*   SD Card autostart support
38
-*   many small but handy things originating from bkubicek's fork.
38
+*   LCD support (ideally 20x4) 
39
-*   Arc support
39
+*   LCD menu system for autonomous SD card printing, controlled by an click-encoder. 
40
-*   Temperature oversampling
40
+*   EEPROM storage of e.g. max-velocity, max-acceleration, and similar variables
41
-*   Dynamic Temperature setpointing aka "AutoTemp"
41
+*   many small but handy things originating from bkubicek's fork.
42
-*   Support for QTMarlin, a very beta GUI for PID-tuning and velocity-acceleration testing. https://github.com/bkubicek/QTMarlin
42
+*   Arc support
43
-*   Endstop trigger reporting to the host software.
43
+*   Temperature oversampling
44
-*   Updated sdcardlib
44
+*   Dynamic Temperature setpointing aka "AutoTemp"
45
-*   Heater power reporting. Useful for PID monitoring.
45
+*   Support for QTMarlin, a very beta GUI for PID-tuning and velocity-acceleration testing. https://github.com/bkubicek/QTMarlin
46
-*   PID tuning
46
+*   Endstop trigger reporting to the host software.
47
-*   CoreXY kinematics (www.corexy.com/theory.html)
47
+*   Updated sdcardlib
48
-*   Configurable serial port to support connection of wireless adaptors.
48
+*   Heater power reporting. Useful for PID monitoring.
49
-
49
+*   PID tuning
50
-The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
50
+*   CoreXY kinematics (www.corexy.com/theory.html)
51
-
51
+*   Configurable serial port to support connection of wireless adaptors.
52
-
52
+*   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
53
-Differences and additions to the already good Sprinter firmware:
53
+
54
-================================================================
54
+The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
55
-
55
+
56
-*Look-ahead:*
56
+
57
-
57
+Differences and additions to the already good Sprinter firmware:
58
-Marlin has look-ahead. While sprinter has to break and re-accelerate at each corner, 
58
+================================================================
59
-lookahead will only decelerate and accelerate to a velocity, 
59
+
60
-so that the change in vectorial velocity magnitude is less than the xy_jerk_velocity.
60
+*Look-ahead:*
61
-This is only possible, if some future moves are already processed, hence the name. 
61
+
62
-It leads to less over-deposition at corners, especially at flat angles.
62
+Marlin has look-ahead. While sprinter has to break and re-accelerate at each corner, 
63
-
63
+lookahead will only decelerate and accelerate to a velocity, 
64
-*Arc support:*
64
+so that the change in vectorial velocity magnitude is less than the xy_jerk_velocity.
65
-
65
+This is only possible, if some future moves are already processed, hence the name. 
66
-Slic3r can find curves that, although broken into segments, were ment to describe an arc.
66
+It leads to less over-deposition at corners, especially at flat angles.
67
-Marlin is able to print those arcs. The advantage is the firmware can choose the resolution,
67
+
68
-and can perform the arc with nearly constant velocity, resulting in a nice finish. 
68
+*Arc support:*
69
-Also, less serial communication is needed.
69
+
70
-
70
+Slic3r can find curves that, although broken into segments, were ment to describe an arc.
71
-*Temperature Oversampling:*
71
+Marlin is able to print those arcs. The advantage is the firmware can choose the resolution,
72
-
72
+and can perform the arc with nearly constant velocity, resulting in a nice finish. 
73
-To reduce noise and make the PID-differential term more useful, 16 ADC conversion results are averaged.
73
+Also, less serial communication is needed.
74
-
74
+
75
-*AutoTemp:*
75
+*Temperature Oversampling:*
76
-
76
+
77
-If your gcode contains a wide spread of extruder velocities, or you realtime change the building speed, the temperature should be changed accordingly.
77
+To reduce noise and make the PID-differential term more useful, 16 ADC conversion results are averaged.
78
-Usually, higher speed requires higher temperature.
78
+
79
-This can now be performed by the AutoTemp function
79
+*AutoTemp:*
80
-By calling M109 S<mintemp> T<maxtemp> F<factor> you enter the autotemp mode.
80
+
81
-
81
+If your gcode contains a wide spread of extruder velocities, or you realtime change the building speed, the temperature should be changed accordingly.
82
-You can leave it by calling M109 without any F.
82
+Usually, higher speed requires higher temperature.
83
-If active, the maximal extruder stepper rate of all buffered moves will be calculated, and named "maxerate" [steps/sec].
83
+This can now be performed by the AutoTemp function
84
-The wanted temperature then will be set to t=tempmin+factor*maxerate, while being limited between tempmin and tempmax.
84
+By calling M109 S<mintemp> T<maxtemp> F<factor> you enter the autotemp mode.
85
-If the target temperature is set manually or by gcode to a value less then tempmin, it will be kept without change.
85
+
86
-Ideally, your gcode can be completely free of temperature controls, apart from a M109 S T F in the start.gcode, and a M109 S0 in the end.gcode.
86
+You can leave it by calling M109 without any F.
87
-
87
+If active, the maximal extruder stepper rate of all buffered moves will be calculated, and named "maxerate" [steps/sec].
88
-*EEPROM:*
88
+The wanted temperature then will be set to t=tempmin+factor*maxerate, while being limited between tempmin and tempmax.
89
-
89
+If the target temperature is set manually or by gcode to a value less then tempmin, it will be kept without change.
90
-If you know your PID values, the acceleration and max-velocities of your unique machine, you can set them, and finally store them in the EEPROM.
90
+Ideally, your gcode can be completely free of temperature controls, apart from a M109 S T F in the start.gcode, and a M109 S0 in the end.gcode.
91
-After each reboot, it will magically load them from EEPROM, independent what your Configuration.h says.
91
+
92
-
92
+*EEPROM:*
93
-*LCD Menu:*
93
+
94
-
94
+If you know your PID values, the acceleration and max-velocities of your unique machine, you can set them, and finally store them in the EEPROM.
95
-If your hardware supports it, you can build yourself a LCD-CardReader+Click+encoder combination. It will enable you to realtime tune temperatures,
95
+After each reboot, it will magically load them from EEPROM, independent what your Configuration.h says.
96
-accelerations, velocities, flow rates, select and print files from the SD card, preheat, disable the steppers, and do other fancy stuff.
96
+
97
-One working hardware is documented here: http://www.thingiverse.com/thing:12663 
97
+*LCD Menu:*
98
-Also, with just a 20x4 or 16x2 display, useful data is shown.
98
+
99
-
99
+If your hardware supports it, you can build yourself a LCD-CardReader+Click+encoder combination. It will enable you to realtime tune temperatures,
100
-*SD card folders:*
100
+accelerations, velocities, flow rates, select and print files from the SD card, preheat, disable the steppers, and do other fancy stuff.
101
-
101
+One working hardware is documented here: http://www.thingiverse.com/thing:12663 
102
-If you have an SD card reader attached to your controller, also folders work now. Listing the files in pronterface will show "/path/subpath/file.g".
102
+Also, with just a 20x4 or 16x2 display, useful data is shown.
103
-You can write to file in a subfolder by specifying a similar text using small letters in the path.
103
+
104
-Also, backup copies of various operating systems are hidden, as well as files not ending with ".g".
104
+*SD card folders:*
105
-
105
+
106
-*SD card folders:*
106
+If you have an SD card reader attached to your controller, also folders work now. Listing the files in pronterface will show "/path/subpath/file.g".
107
-
107
+You can write to file in a subfolder by specifying a similar text using small letters in the path.
108
-If you place a file auto[0-9].g into the root of the sd card, it will be automatically executed if you boot the printer. The same file will be executed by selecting "Autostart" from the menu.
108
+Also, backup copies of various operating systems are hidden, as well as files not ending with ".g".
109
-First *0 will be performed, than *1 and so on. That way, you can heat up or even print automatically without user interaction.
109
+
110
-
110
+*SD card folders:*
111
-*Endstop trigger reporting:*
111
+
112
-
112
+If you place a file auto[0-9].g into the root of the sd card, it will be automatically executed if you boot the printer. The same file will be executed by selecting "Autostart" from the menu.
113
-If an endstop is hit while moving towards the endstop, the location at which the firmware thinks that the endstop was triggered is outputed on the serial port.
113
+First *0 will be performed, than *1 and so on. That way, you can heat up or even print automatically without user interaction.
114
-This is useful, because the user gets a warning message.
114
+
115
-However, also tools like QTMarlin can use this for finding acceptable combinations of velocity+acceleration.
115
+*Endstop trigger reporting:*
116
-
116
+
117
-*Coding paradigm:*
117
+If an endstop is hit while moving towards the endstop, the location at which the firmware thinks that the endstop was triggered is outputed on the serial port.
118
-
118
+This is useful, because the user gets a warning message.
119
-Not relevant from a user side, but Marlin was split into thematic junks, and has tried to partially enforced private variables.
119
+However, also tools like QTMarlin can use this for finding acceptable combinations of velocity+acceleration.
120
-This is intended to make it clearer, what interacts which what, and leads to a higher level of modularization.
120
+
121
-We think that this is a useful prestep for porting this firmware to e.g. an ARM platform in the future.
121
+*Coding paradigm:*
122
-A lot of RAM (with enabled LCD ~2200 bytes) was saved by storing char []="some message" in Program memory.
122
+
123
-In the serial communication, a #define based level of abstraction was enforced, so that it is clear that
123
+Not relevant from a user side, but Marlin was split into thematic junks, and has tried to partially enforced private variables.
124
-some transfer is information (usually beginning with "echo:"), an error "error:", or just normal protocol,
124
+This is intended to make it clearer, what interacts which what, and leads to a higher level of modularization.
125
-necessary for backwards compatibility.
125
+We think that this is a useful prestep for porting this firmware to e.g. an ARM platform in the future.
126
-
126
+A lot of RAM (with enabled LCD ~2200 bytes) was saved by storing char []="some message" in Program memory.
127
-*Interrupt based temperature measurements:*
127
+In the serial communication, a #define based level of abstraction was enforced, so that it is clear that
128
-
128
+some transfer is information (usually beginning with "echo:"), an error "error:", or just normal protocol,
129
-An interrupt is used to manage ADC conversions, and enforce checking for critical temperatures.
129
+necessary for backwards compatibility.
130
-This leads to less blocking in the heater management routine.
130
+
131
-
131
+*Interrupt based temperature measurements:*
132
-
132
+
133
-Non-standard M-Codes, different to an old version of sprinter:
133
+An interrupt is used to manage ADC conversions, and enforce checking for critical temperatures.
134
-==============================================================
134
+This leads to less blocking in the heater management routine.
135
-Movement:
135
+
136
-
136
+
137
-*   G2  - CW ARC
137
+Non-standard M-Codes, different to an old version of sprinter:
138
-*   G3  - CCW ARC
138
+==============================================================
139
-
139
+Movement:
140
-General:
140
+
141
-
141
+*   G2  - CW ARC
142
-*   M17  - Enable/Power all stepper motors. Compatibility to ReplicatorG.
142
+*   G3  - CCW ARC
143
-*   M18  - Disable all stepper motors; same as M84.Compatibility to ReplicatorG.
143
+
144
-*   M30  - Print time since last M109 or SD card start to serial
144
+General:
145
-*   M42  - Change pin status via gcode
145
+
146
-*   M80  - Turn on Power Supply
146
+*   M17  - Enable/Power all stepper motors. Compatibility to ReplicatorG.
147
-*   M81  - Turn off Power Supply
147
+*   M18  - Disable all stepper motors; same as M84.Compatibility to ReplicatorG.
148
-*   M114 - Output current position to serial port 
148
+*   M30  - Print time since last M109 or SD card start to serial
149
-*   M119 - Output Endstop status to serial port
149
+*   M42  - Change pin status via gcode
150
-
150
+*   M80  - Turn on Power Supply
151
-Movement variables:
151
+*   M81  - Turn off Power Supply
152
-
152
+*   M114 - Output current position to serial port 
153
-*   M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
153
+*   M119 - Output Endstop status to serial port
154
-*   M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
154
+
155
-*   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
155
+Movement variables:
156
-*   M206 - set home offsets.  This sets the X,Y,Z coordinates of the endstops (and is added to the {X,Y,Z}_HOME_POS configuration options (and is also added to the coordinates, if any, provided to G82, as with earlier firmware)
156
+
157
-*   M220 - set build speed mulitplying S:factor in percent ; aka "realtime tuneing in the gcode". So you can slow down if you have islands in one height-range, and speed up otherwise.
157
+*   M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
158
-*   M221 - set the extrude multiplying S:factor in percent
158
+*   M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
159
-*   M400 - Finish all buffered moves.
159
+*   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
160
-
160
+*   M206 - set home offsets.  This sets the X,Y,Z coordinates of the endstops (and is added to the {X,Y,Z}_HOME_POS configuration options (and is also added to the coordinates, if any, provided to G82, as with earlier firmware)
161
-Temperature variables:
161
+*   M220 - set build speed mulitplying S:factor in percent ; aka "realtime tuneing in the gcode". So you can slow down if you have islands in one height-range, and speed up otherwise.
162
-*   M301 - Set PID parameters P I and D
162
+*   M221 - set the extrude multiplying S:factor in percent
163
-*   M302 - Allow cold extrudes
163
+*   M400 - Finish all buffered moves.
164
-*   M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
164
+
165
-
165
+Temperature variables:
166
-Advance:
166
+*   M301 - Set PID parameters P I and D
167
-
167
+*   M302 - Allow cold extrudes
168
-*   M200 - Set filament diameter for advance
168
+*   M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
169
-*   M205 - advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk
169
+
170
-
170
+Advance:
171
-EEPROM:
171
+
172
-
172
+*   M200 - Set filament diameter for advance
173
-*   M500 - stores paramters in EEPROM. This parameters are stored:  axis_steps_per_unit,  max_feedrate, max_acceleration  ,acceleration,retract_acceleration,
173
+*   M205 - advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk
174
-  minimumfeedrate,mintravelfeedrate,minsegmenttime,  jerk velocities, PID
174
+
175
-*   M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
175
+EEPROM:
176
-*   M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
176
+
177
-*   M503 - print the current settings (from memory not from eeprom)
177
+*   M500 - stores paramters in EEPROM. This parameters are stored:  axis_steps_per_unit,  max_feedrate, max_acceleration  ,acceleration,retract_acceleration,
178
-
178
+  minimumfeedrate,mintravelfeedrate,minsegmenttime,  jerk velocities, PID
179
-MISC:
179
+*   M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
180
-
180
+*   M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
181
-*   M240 - Trigger a camera to take a photograph
181
+*   M503 - print the current settings (from memory not from eeprom)
182
-*   M999 - Restart after being stopped by error
182
+
183
-
183
+MISC:
184
-Configuring and compilation:
184
+
185
-============================
185
+*   M240 - Trigger a camera to take a photograph
186
-
186
+*   M999 - Restart after being stopped by error
187
-Install the arduino software IDE/toolset v23 (Some configurations also work with 1.x.x)
187
+
188
-   http://www.arduino.cc/en/Main/Software
188
+Configuring and compilation:
189
-
189
+============================
190
-For gen6/gen7 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment.
190
+
191
-  copy ArduinoAddons\Arduino_x.x.x\sanguino <arduino home>\hardware\Sanguino
191
+Install the arduino software IDE/toolset v23 (Some configurations also work with 1.x.x)
192
-
192
+   http://www.arduino.cc/en/Main/Software
193
-Install Ultimaker's RepG 25 build
193
+
194
-    http://software.ultimaker.com
194
+For gen6/gen7 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment.
195
-For SD handling and as better substitute (apart from stl manipulation) download
195
+  copy ArduinoAddons\Arduino_x.x.x\sanguino <arduino home>\hardware\Sanguino
196
-the very nice Kliment's printrun/pronterface  https://github.com/kliment/Printrun
196
+
197
-
197
+Install Ultimaker's RepG 25 build
198
-Copy the Ultimaker Marlin firmware
198
+    http://software.ultimaker.com
199
-   https://github.com/ErikZalm/Marlin/tree/Marlin_v1
199
+For SD handling and as better substitute (apart from stl manipulation) download
200
-   (Use the download button)
200
+the very nice Kliment's printrun/pronterface  https://github.com/kliment/Printrun
201
-
201
+
202
-Start the arduino IDE.
202
+Copy the Ultimaker Marlin firmware
203
-Select Tools -> Board -> Arduino Mega 2560    or your microcontroller
203
+   https://github.com/ErikZalm/Marlin/tree/Marlin_v1
204
-Select the correct serial port in Tools ->Serial Port
204
+   (Use the download button)
205
-Open Marlin.pde
205
+
206
-
206
+Start the arduino IDE.
207
-Click the Verify/Compile button
207
+Select Tools -> Board -> Arduino Mega 2560    or your microcontroller
208
-
208
+Select the correct serial port in Tools ->Serial Port
209
-Click the Upload button
209
+Open Marlin.pde
210
-If all goes well the firmware is uploading
210
+
211
-
211
+Click the Verify/Compile button
212
-Start Ultimaker's Custom RepG 25
212
+
213
-Make sure Show Experimental Profiles is enabled in Preferences
213
+Click the Upload button
214
-Select Sprinter as the Driver
214
+If all goes well the firmware is uploading
215
-
215
+
216
-Press the Connect button.
216
+Start Ultimaker's Custom RepG 25
217
-
217
+Make sure Show Experimental Profiles is enabled in Preferences
218
-KNOWN ISSUES: RepG will display:  Unknown: marlin x.y.z
218
+Select Sprinter as the Driver
219
-
219
+
220
-That's ok.  Enjoy Silky Smooth Printing.
220
+Press the Connect button.
221
-
221
+
222
-
222
+KNOWN ISSUES: RepG will display:  Unknown: marlin x.y.z
223
-
223
+
224
+That's ok.  Enjoy Silky Smooth Printing.
225
+
226
+
227
+

Loading…
取消
儲存