Browse Source

Merge pull request #172 from daid/Marlin_v1

Add M401 - Wait for user to press button on LCD (with optional timeout) minor fix in M115.
Bernhard Kubicek 12 years ago
parent
commit
c7ce99d495
7 changed files with 67 additions and 13 deletions
  1. 3
    0
      Marlin/Configuration.h
  2. 33
    1
      Marlin/Marlin.pde
  3. 24
    11
      Marlin/language.h
  4. 1
    1
      Marlin/pins.h
  5. 2
    0
      Marlin/planner.cpp
  6. 1
    0
      Marlin/ultralcd.h
  7. 3
    0
      Marlin/ultralcd.pde

+ 3
- 0
Marlin/Configuration.h View File

109
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
109
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
110
 //can be software-disabled for whatever purposes by
110
 //can be software-disabled for whatever purposes by
111
 #define PREVENT_DANGEROUS_EXTRUDE
111
 #define PREVENT_DANGEROUS_EXTRUDE
112
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
113
+#define PREVENT_LENGTHY_EXTRUDE
114
+
112
 #define EXTRUDE_MINTEMP 170
115
 #define EXTRUDE_MINTEMP 170
113
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
116
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
114
 
117
 

+ 33
- 1
Marlin/Marlin.pde View File

56
 // G92 - Set current position to cordinates given
56
 // G92 - Set current position to cordinates given
57
 
57
 
58
 //RepRap M Codes
58
 //RepRap M Codes
59
+// M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
60
+// M1   - Same as M0
59
 // M104 - Set extruder target temp
61
 // M104 - Set extruder target temp
60
 // M105 - Read current temp
62
 // M105 - Read current temp
61
 // M106 - Fan on
63
 // M106 - Fan on
596
       while(millis()  < codenum ){
598
       while(millis()  < codenum ){
597
         manage_heater();
599
         manage_heater();
598
         manage_inactivity(1);
600
         manage_inactivity(1);
601
+		LCD_STATUS;
599
       }
602
       }
600
       break;
603
       break;
601
     case 28: //G28 Home all Axis one at a time
604
     case 28: //G28 Home all Axis one at a time
707
   {
710
   {
708
     switch( (int)code_value() ) 
711
     switch( (int)code_value() ) 
709
     {
712
     {
713
+#ifdef ULTRA_LCD
714
+    case 0: // M0 - Unconditional stop - Wait for user button press on LCD
715
+    case 1: // M1 - Conditional stop - Wait for user button press on LCD
716
+    {
717
+      LCD_MESSAGEPGM(MSG_USERWAIT);
718
+      codenum = 0;
719
+      if(code_seen('P')) codenum = code_value(); // milliseconds to wait
720
+      if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
721
+      
722
+      st_synchronize();
723
+      previous_millis_cmd = millis();
724
+	  if (codenum > 0)
725
+	  {
726
+        codenum += millis();  // keep track of when we started waiting
727
+        while(millis()  < codenum && !CLICKED){
728
+          manage_heater();
729
+          manage_inactivity(1);
730
+		  LCD_STATUS;
731
+		}
732
+      }else{
733
+        while(!CLICKED) {
734
+          manage_heater();
735
+          manage_inactivity(1);
736
+		  LCD_STATUS;
737
+		}
738
+	  }
739
+    }
740
+    break;
741
+#endif
710
     case 17:
742
     case 17:
711
         LCD_MESSAGEPGM(MSG_NO_MOVE);
743
         LCD_MESSAGEPGM(MSG_NO_MOVE);
712
         enable_x(); 
744
         enable_x(); 
1259
       PID_autotune(temp);
1291
       PID_autotune(temp);
1260
     }
1292
     }
1261
     break;
1293
     break;
1262
-    case 400: // finish all moves
1294
+    case 400: // M400 finish all moves
1263
     {
1295
     {
1264
       st_synchronize();
1296
       st_synchronize();
1265
     }
1297
     }

+ 24
- 11
Marlin/language.h View File

10
 
10
 
11
 #define LANGUAGE_CHOICE 1  // Pick your language from the list above
11
 #define LANGUAGE_CHOICE 1  // Pick your language from the list above
12
 
12
 
13
+#define PROTOCOL_VERSION "1.0"
14
+
15
+#if MOTHERBOARD == 7 || MOTHERBOARD == 71
16
+	#define MACHINE_NAME "Ultimaker"
17
+	#define FIRMWARE_URL "http://firmware.ultimaker.com"
18
+#else
19
+	#define MACHINE_NAME "Mendel"
20
+	#define FIRMWARE_URL "http://www.mendel-parts.com"
21
+#endif
22
+
23
+#define STRINGIFY_(n) #n
24
+#define STRINGIFY(n) STRINGIFY_(n)
25
+
13
 #if LANGUAGE_CHOICE == 1
26
 #if LANGUAGE_CHOICE == 1
14
 
27
 
15
 // LCD Menu Messages
28
 // LCD Menu Messages
16
-
17
-	#define WELCOME_MSG "Printer Ready."
29
+	#define WELCOME_MSG MACHINE_NAME " Ready."
18
 	#define MSG_SD_INSERTED "Card inserted"
30
 	#define MSG_SD_INSERTED "Card inserted"
19
 	#define MSG_SD_REMOVED "Card removed"
31
 	#define MSG_SD_REMOVED "Card removed"
20
 	#define MSG_MAIN " Main \003"
32
 	#define MSG_MAIN " Main \003"
63
 	#define MSG_MAIN_WIDE " Main        \003"
75
 	#define MSG_MAIN_WIDE " Main        \003"
64
 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
76
 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
65
 	#define MSG_MOTION_WIDE " Motion      \x7E"
77
 	#define MSG_MOTION_WIDE " Motion      \x7E"
66
-	#define MSG_STORE_EPROM " Store EPROM"
67
-	#define MSG_LOAD_EPROM " Load EPROM"
78
+	#define MSG_STORE_EPROM " Store memory"
79
+	#define MSG_LOAD_EPROM " Load memory"
68
 	#define MSG_RESTORE_FAILSAFE " Restore Failsafe"
80
 	#define MSG_RESTORE_FAILSAFE " Restore Failsafe"
69
 	#define MSG_REFRESH "\004Refresh"
81
 	#define MSG_REFRESH "\004Refresh"
70
 	#define MSG_WATCH " Watch   \003"
82
 	#define MSG_WATCH " Watch   \003"
76
 	#define MSG_CARD_MENU " Card Menu    \x7E"
88
 	#define MSG_CARD_MENU " Card Menu    \x7E"
77
 	#define MSG_NO_CARD " No Card"
89
 	#define MSG_NO_CARD " No Card"
78
 	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
90
 	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
79
-	#define MSG_DWELL "DWELL..."		
91
+	#define MSG_DWELL "Sleep..."
92
+	#define MSG_USERWAIT "Wait for user..."
80
 	#define MSG_NO_MOVE "No move."
93
 	#define MSG_NO_MOVE "No move."
81
 	#define MSG_PART_RELEASE "Partial Release"
94
 	#define MSG_PART_RELEASE "Partial Release"
82
 	#define MSG_KILLED "KILLED. "
95
 	#define MSG_KILLED "KILLED. "
83
-        #define MSG_STOPPED "STOPPED. "
96
+	#define MSG_STOPPED "STOPPED. "
84
 	#define MSG_PREHEAT_PLA " Preheat PLA"
97
 	#define MSG_PREHEAT_PLA " Preheat PLA"
85
 	#define MSG_PREHEAT_ABS " Preheat ABS"
98
 	#define MSG_PREHEAT_ABS " Preheat ABS"
86
 	#define MSG_STEPPER_RELEASED "Released."
99
 	#define MSG_STEPPER_RELEASED "Released."
94
 	#define MSG_BROWNOUT_RESET " Brown out Reset"
107
 	#define MSG_BROWNOUT_RESET " Brown out Reset"
95
 	#define MSG_WATCHDOG_RESET " Watchdog Reset"
108
 	#define MSG_WATCHDOG_RESET " Watchdog Reset"
96
 	#define MSG_SOFTWARE_RESET " Software Reset"
109
 	#define MSG_SOFTWARE_RESET " Software Reset"
97
-	#define MSG_MARLIN "Marlin: "
110
+	#define MSG_MARLIN "Marlin "
98
 	#define MSG_AUTHOR " | Author: "
111
 	#define MSG_AUTHOR " | Author: "
99
 	#define MSG_CONFIGURATION_VER " Last Updated: "
112
 	#define MSG_CONFIGURATION_VER " Last Updated: "
100
 	#define MSG_FREE_MEMORY " Free Memory: "
113
 	#define MSG_FREE_MEMORY " Free Memory: "
116
 	#define MSG_HEATING_COMPLETE "Heating done."
129
 	#define MSG_HEATING_COMPLETE "Heating done."
117
 	#define MSG_BED_HEATING "Bed Heating."
130
 	#define MSG_BED_HEATING "Bed Heating."
118
 	#define MSG_BED_DONE "Bed done."
131
 	#define MSG_BED_DONE "Bed done."
119
-	#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1\n"
132
+	#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n"
120
 	#define MSG_COUNT_X " Count X:"
133
 	#define MSG_COUNT_X " Count X:"
121
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
134
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
122
 	#define MSG_ERR_STOPPED "Printer stopped deu to errors. Fix the error and use M999 to restart!. (Temperature is reset. Set it before restarting)"
135
 	#define MSG_ERR_STOPPED "Printer stopped deu to errors. Fix the error and use M999 to restart!. (Temperature is reset. Set it before restarting)"
157
 
170
 
158
 // LCD Menu Messages
171
 // LCD Menu Messages
159
 
172
 
160
-	#define WELCOME_MSG "UltiMARLIN Ready."
173
+	#define WELCOME_MSG MACHINE_NAME " Ready."
161
 
174
 
162
 	#define MSG_SD_INSERTED "Card inserted"
175
 	#define MSG_SD_INSERTED "Card inserted"
163
 	#define MSG_SD_REMOVED "Card removed"
176
 	#define MSG_SD_REMOVED "Card removed"
173
 	#define MSG_PREHEAT_PLA " Preheat PLA"
186
 	#define MSG_PREHEAT_PLA " Preheat PLA"
174
 	#define MSG_PREHEAT_ABS " Preheat ABS"
187
 	#define MSG_PREHEAT_ABS " Preheat ABS"
175
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
188
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
176
-        #define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
189
+	#define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
177
 	#define MSG_SPEED " Geschw:"
190
 	#define MSG_SPEED " Geschw:"
178
 	#define MSG_NOZZLE " \002Duese:"
191
 	#define MSG_NOZZLE " \002Duese:"
179
 	#define MSG_NOZZLE1 " \002Duese2:"
192
 	#define MSG_NOZZLE1 " \002Duese2:"
263
 	#define MSG_HEATING_COMPLETE "Heating done."
276
 	#define MSG_HEATING_COMPLETE "Heating done."
264
 	#define MSG_BED_HEATING "Bed Heating."
277
 	#define MSG_BED_HEATING "Bed Heating."
265
 	#define MSG_BED_DONE "Bed done."
278
 	#define MSG_BED_DONE "Bed done."
266
-	#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1\n"
279
+	#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n"
267
 	#define MSG_COUNT_X " Count X:"
280
 	#define MSG_COUNT_X " Count X:"
268
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
281
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
269
 	#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart!"
282
 	#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart!"

+ 1
- 1
Marlin/pins.h View File

684
 
684
 
685
 #define E1_STEP_PIN         49
685
 #define E1_STEP_PIN         49
686
 #define E1_DIR_PIN          47
686
 #define E1_DIR_PIN          47
687
-#define E1_ENABLE_PIN       51
687
+#define E1_ENABLE_PIN       48
688
 
688
 
689
 #define SDPOWER            -1
689
 #define SDPOWER            -1
690
 #define SDSS               53
690
 #define SDSS               53

+ 2
- 0
Marlin/planner.cpp View File

495
       SERIAL_ECHO_START;
495
       SERIAL_ECHO_START;
496
       SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
496
       SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
497
     }
497
     }
498
+    #ifdef PREVENT_LENGTHY_EXTRUDE
498
     if(labs(target[E_AXIS]-position[E_AXIS])>axis_steps_per_unit[E_AXIS]*EXTRUDE_MAXLENGTH)
499
     if(labs(target[E_AXIS]-position[E_AXIS])>axis_steps_per_unit[E_AXIS]*EXTRUDE_MAXLENGTH)
499
     {
500
     {
500
       position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
501
       position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
501
       SERIAL_ECHO_START;
502
       SERIAL_ECHO_START;
502
       SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
503
       SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
503
     }
504
     }
505
+    #endif
504
   #endif
506
   #endif
505
   
507
   
506
   // Prepare to set up new block
508
   // Prepare to set up new block

+ 1
- 0
Marlin/ultralcd.h View File

13
   #define LCD_UPDATE_INTERVAL 100
13
   #define LCD_UPDATE_INTERVAL 100
14
   #define STATUSTIMEOUT 15000
14
   #define STATUSTIMEOUT 15000
15
   extern LiquidCrystal lcd;
15
   extern LiquidCrystal lcd;
16
+  extern volatile char buttons;  //the last checked buttons in a bit array.
16
   
17
   
17
   #ifdef NEWPANEL
18
   #ifdef NEWPANEL
18
     #define EN_C (1<<BLEN_C)
19
     #define EN_C (1<<BLEN_C)

+ 3
- 0
Marlin/ultralcd.pde View File

1
+#include "language.h"
2
+#include "temperature.h"
1
 #include "ultralcd.h"
3
 #include "ultralcd.h"
2
 #ifdef ULTRA_LCD
4
 #ifdef ULTRA_LCD
3
 #include "Marlin.h"
5
 #include "Marlin.h"
711
           }
713
           }
712
           break;
714
           break;
713
           case ItemAM_E:
715
           case ItemAM_E:
716
+          // ErikDB: TODO: this length should be changed for volumetric.
714
           MENUITEM(  lcdprintPGM(MSG_EXTRUDE)  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E5");beepshort(); ) ;
717
           MENUITEM(  lcdprintPGM(MSG_EXTRUDE)  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E5");beepshort(); ) ;
715
           break;
718
           break;
716
           default:
719
           default:

Loading…
Cancel
Save