Christian Thalhammer преди 13 години
родител
ревизия
0e3631ff4b
променени са 3 файла, в които са добавени 304 реда и са изтрити 88 реда
  1. 83
    80
      Marlin/Configuration.h
  2. 3
    1
      Marlin/Marlin.pde
  3. 218
    7
      Marlin/ultralcd.pde

+ 83
- 80
Marlin/Configuration.h Целия файл

4
 
4
 
5
 
5
 
6
 // This determines the communication speed of the printer
6
 // This determines the communication speed of the printer
7
-#define BAUDRATE 250000
8
-//#define BAUDRATE 115200
7
+//#define BAUDRATE 250000
8
+#define BAUDRATE 115200
9
 //#define BAUDRATE 230400
9
 //#define BAUDRATE 230400
10
 
10
 
11
 #define EXTRUDERS 1
11
 #define EXTRUDERS 1
26
 // MEGA/RAMPS up to 1.2 = 3,
26
 // MEGA/RAMPS up to 1.2 = 3,
27
 // RAMPS 1.3 = 33
27
 // RAMPS 1.3 = 33
28
 // Gen6 = 5,
28
 // Gen6 = 5,
29
-// Sanguinololu 1.2 and above = 62,
30
-// Ultimaker = 7,
29
+// Sanguinololu 1.2 and above = 62
31
 // Gen7 = 77,
30
 // Gen7 = 77,
31
+// Ultimaker = 7,
32
 // Teensylu = 8
32
 // Teensylu = 8
33
-#define MOTHERBOARD 7
33
+#define MOTHERBOARD 77
34
 
34
 
35
 //===========================================================================
35
 //===========================================================================
36
 //=============================Thermal Settings  ============================
36
 //=============================Thermal Settings  ============================
45
 // 6 is EPCOS 100k
45
 // 6 is EPCOS 100k
46
 // 7 is 100k Honeywell thermistor 135-104LAG-J01
46
 // 7 is 100k Honeywell thermistor 135-104LAG-J01
47
 
47
 
48
-//#define THERMISTORHEATER_0 3
48
+#define THERMISTORHEATER_0 1
49
 //#define THERMISTORHEATER_1 1
49
 //#define THERMISTORHEATER_1 1
50
 //#define THERMISTORHEATER_2 1
50
 //#define THERMISTORHEATER_2 1
51
 
51
 
52
-//#define HEATER_0_USES_THERMISTOR
52
+#define HEATER_0_USES_THERMISTOR
53
 //#define HEATER_1_USES_THERMISTOR
53
 //#define HEATER_1_USES_THERMISTOR
54
 //#define HEATER_2_USES_THERMISTOR
54
 //#define HEATER_2_USES_THERMISTOR
55
-#define HEATER_0_USES_AD595
55
+//#define HEATER_0_USES_AD595
56
 //#define HEATER_1_USES_AD595
56
 //#define HEATER_1_USES_AD595
57
 //#define HEATER_2_USES_AD595
57
 //#define HEATER_2_USES_AD595
58
 
58
 
59
 // Select one of these only to define how the bed temp is read.
59
 // Select one of these only to define how the bed temp is read.
60
-//#define THERMISTORBED 1
61
-//#define BED_USES_THERMISTOR
60
+#define THERMISTORBED 1
61
+#define BED_USES_THERMISTOR
62
 //#define BED_LIMIT_SWITCHING
62
 //#define BED_LIMIT_SWITCHING
63
 #ifdef BED_LIMIT_SWITCHING
63
 #ifdef BED_LIMIT_SWITCHING
64
-  #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
64
+#define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
65
 #endif
65
 #endif
66
 //#define BED_USES_AD595
66
 //#define BED_USES_AD595
67
 
67
 
75
 
75
 
76
 // Actual temperature must be close to target for this long before M109 returns success
76
 // Actual temperature must be close to target for this long before M109 returns success
77
 #define TEMP_RESIDENCY_TIME 30  // (seconds)
77
 #define TEMP_RESIDENCY_TIME 30  // (seconds)
78
-#define TEMP_HYSTERESIS 3       // (C°) range of +/- temperatures considered "close" to the target one
78
+#define TEMP_HYSTERESIS 3       // (C°) range of +/- temperatures considered "close" to the target one
79
 
79
 
80
 //// The minimal temperature defines the temperature below which the heater will not be enabled
80
 //// The minimal temperature defines the temperature below which the heater will not be enabled
81
-#define HEATER_0_MINTEMP 5
81
+//#define HEATER_0_MINTEMP 5
82
 //#define HEATER_1_MINTEMP 5
82
 //#define HEATER_1_MINTEMP 5
83
 //#define HEATER_2_MINTEMP 5
83
 //#define HEATER_2_MINTEMP 5
84
 //#define BED_MINTEMP 5
84
 //#define BED_MINTEMP 5
107
 #define PIDTEMP
107
 #define PIDTEMP
108
 #define PID_MAX 255 // limits current to nozzle; 255=full current
108
 #define PID_MAX 255 // limits current to nozzle; 255=full current
109
 #ifdef PIDTEMP
109
 #ifdef PIDTEMP
110
-  //#define PID_DEBUG // Sends debug data to the serial port. 
111
-  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104 sets the output power in %
112
-  #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
113
-  #define K1 0.95 //smoothing factor withing the PID
114
-  #define PID_dT 0.128 //sampling period of the PID
115
-
116
-  //To develop some PID settings for your machine, you can initiall follow 
117
-  // the Ziegler-Nichols method.
118
-  // set Ki and Kd to zero. 
119
-  // heat with a defined Kp and see if the temperature stabilizes
120
-  // ideally you do this graphically with repg.
121
-  // the PID_CRITIAL_GAIN should be the Kp at which temperature oscillatins are not dampned out/decreas in amplitutde
122
-  // PID_SWING_AT_CRITIAL is the time for a full period of the oscillations at the critical Gain
123
-  // usually further manual tunine is necessary.
124
-
125
-  #define PID_CRITIAL_GAIN 50
126
-  #define PID_SWING_AT_CRITIAL 47 //seconds
127
-  
128
-  //#define PID_PI    //no differentail term
129
-  #define PID_PID //normal PID
130
-
131
-  #ifdef PID_PID
132
-    //PID according to Ziegler-Nichols method
110
+//#define PID_DEBUG // Sends debug data to the serial port. 
111
+//#define PID_OPENLOOP 1 // Puts PID in open loop. M104 sets the output power in %
112
+#define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
113
+#define K1 0.95 //smoothing factor withing the PID
114
+#define PID_dT 0.128 //sampling period of the PID
115
+
116
+//To develop some PID settings for your machine, you can initiall follow 
117
+// the Ziegler-Nichols method.
118
+// set Ki and Kd to zero. 
119
+// heat with a defined Kp and see if the temperature stabilizes
120
+// ideally you do this graphically with repg.
121
+// the PID_CRITIAL_GAIN should be the Kp at which temperature oscillatins are not dampned out/decreas in amplitutde
122
+// PID_SWING_AT_CRITIAL is the time for a full period of the oscillations at the critical Gain
123
+// usually further manual tunine is necessary.
124
+
125
+#define PID_CRITIAL_GAIN 50
126
+#define PID_SWING_AT_CRITIAL 47 //seconds
127
+
128
+//#define PID_PI    //no differentail term
129
+#define PID_PID //normal PID
130
+
131
+#ifdef PID_PID
132
+//PID according to Ziegler-Nichols method
133
 //    #define  DEFAULT_Kp  (0.6*PID_CRITIAL_GAIN)
133
 //    #define  DEFAULT_Kp  (0.6*PID_CRITIAL_GAIN)
134
 //    #define  DEFAULT_Ki (2*Kp/PID_SWING_AT_CRITIAL*PID_dT)  
134
 //    #define  DEFAULT_Ki (2*Kp/PID_SWING_AT_CRITIAL*PID_dT)  
135
 //    #define  DEFAULT_Kd (PID_SWING_AT_CRITIAL/8./PID_dT)  
135
 //    #define  DEFAULT_Kd (PID_SWING_AT_CRITIAL/8./PID_dT)  
136
 
136
 
137
 // Ultitmaker
137
 // Ultitmaker
138
-    #define  DEFAULT_Kp  22.2
139
-    #define  DEFAULT_Ki (1.25*PID_dT)  
140
-    #define  DEFAULT_Kd (99/PID_dT)  
138
+#define  DEFAULT_Kp  22.2
139
+#define  DEFAULT_Ki (1.25*PID_dT)  
140
+#define  DEFAULT_Kd (99/PID_dT)  
141
 
141
 
142
 // Makergear
142
 // Makergear
143
 //    #define  DEFAULT_Kp 7.0
143
 //    #define  DEFAULT_Kp 7.0
148
 //    #define  DEFAULT_Kp  63.0
148
 //    #define  DEFAULT_Kp  63.0
149
 //    #define  DEFAULT_Ki (2.25*PID_dT)  
149
 //    #define  DEFAULT_Ki (2.25*PID_dT)  
150
 //    #define  DEFAULT_Kd (440/PID_dT)  
150
 //    #define  DEFAULT_Kd (440/PID_dT)  
151
-  #endif
152
-   
153
-  #ifdef PID_PI
154
-    //PI according to Ziegler-Nichols method
155
-    #define  DEFAULT_Kp (PID_CRITIAL_GAIN/2.2) 
156
-    #define  DEFAULT_Ki (1.2*Kp/PID_SWING_AT_CRITIAL*PID_dT)
157
-    #define  DEFAULT_Kd (0)
158
-  #endif
159
-  
160
-  // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
161
-  // if Kc is choosen well, the additional required power due to increased melting should be compensated.
162
-  #define PID_ADD_EXTRUSION_RATE  
163
-  #ifdef PID_ADD_EXTRUSION_RATE
164
-    #define  DEFAULT_Kc (1) //heatingpower=Kc*(e_speed)
165
-  #endif
151
+#endif
152
+
153
+#ifdef PID_PI
154
+//PI according to Ziegler-Nichols method
155
+#define  DEFAULT_Kp (PID_CRITIAL_GAIN/2.2) 
156
+#define  DEFAULT_Ki (1.2*Kp/PID_SWING_AT_CRITIAL*PID_dT)
157
+#define  DEFAULT_Kd (0)
158
+#endif
159
+
160
+// this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
161
+// if Kc is choosen well, the additional required power due to increased melting should be compensated.
162
+#define PID_ADD_EXTRUSION_RATE  
163
+#ifdef PID_ADD_EXTRUSION_RATE
164
+#define  DEFAULT_Kc (1) //heatingpower=Kc*(e_speed)
165
+#endif
166
 #endif // PIDTEMP
166
 #endif // PIDTEMP
167
 
167
 
168
 //  extruder run-out prevention. 
168
 //  extruder run-out prevention. 
184
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
184
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
185
 
185
 
186
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
186
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
187
-const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
188
-const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
189
-const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
187
+const bool X_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. 
188
+const bool Y_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. 
189
+const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. 
190
 // For optos H21LOB set to true, for Mendel-Parts newer optos TCST2103 set to false
190
 // For optos H21LOB set to true, for Mendel-Parts newer optos TCST2103 set to false
191
 
191
 
192
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
192
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
209
 //#define INVERT_Z_DIR false    // for Mendel set to false, for Orca set to true
209
 //#define INVERT_Z_DIR false    // for Mendel set to false, for Orca set to true
210
 //#define INVERT_E*_DIR true   // for direct drive extruder v9 set to true, for geared extruder set to false, used for all extruders
210
 //#define INVERT_E*_DIR true   // for direct drive extruder v9 set to true, for geared extruder set to false, used for all extruders
211
 
211
 
212
-#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
212
+#define INVERT_X_DIR false    // for Mendel set to false, for Orca set to true
213
 #define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
213
 #define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
214
-#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true
214
+#define INVERT_Z_DIR false     // for Mendel set to false, for Orca set to true
215
 #define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
215
 #define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
216
 #define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
216
 #define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
217
 #define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
217
 #define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
256
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
256
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
257
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
257
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
258
 
258
 
259
-// minimum time in microseconds that a movement needs to take if the buffer is emptied.   Increase this number if you see blobs while printing high speed & high detail.  It will slowdown on the detailed stuff.
259
+// minimum time in microseconds that a movement needs to take if the buffer is emptied.   Increase this number if you see blobs while
260
+//printing high speed & high detail.  It will slowdown on the detailed stuff.
260
 #define DEFAULT_MINSEGMENTTIME        20000   // Obsolete delete this
261
 #define DEFAULT_MINSEGMENTTIME        20000   // Obsolete delete this
261
 #define DEFAULT_XYJERK                20.0    // (mm/sec)
262
 #define DEFAULT_XYJERK                20.0    // (mm/sec)
262
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
263
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
290
 // this enables the watchdog interrupt.
291
 // this enables the watchdog interrupt.
291
 //#define USE_WATCHDOG
292
 //#define USE_WATCHDOG
292
 //#ifdef USE_WATCHDOG
293
 //#ifdef USE_WATCHDOG
293
-  // you cannot reboot on a mega2560 due to a bug in he bootloader. Hence, you have to reset manually, and this is done hereby:
294
+// you cannot reboot on a mega2560 due to a bug in he bootloader. Hence, you have to reset manually, and this is done hereby:
294
 //#define RESET_MANUAL
295
 //#define RESET_MANUAL
295
 //#define WATCHDOG_TIMEOUT 4  //seconds
296
 //#define WATCHDOG_TIMEOUT 4  //seconds
296
 //#endif
297
 //#endif
305
 //#define ADVANCE
306
 //#define ADVANCE
306
 
307
 
307
 #ifdef ADVANCE
308
 #ifdef ADVANCE
308
-  #define EXTRUDER_ADVANCE_K .0
309
+#define EXTRUDER_ADVANCE_K .0
309
 
310
 
310
-  #define D_FILAMENT 2.85
311
-  #define STEPS_MM_E 836
312
-  #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
313
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA)
311
+#define D_FILAMENT 2.85
312
+#define STEPS_MM_E 836
313
+#define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
314
+#define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA)
314
 
315
 
315
 #endif // ADVANCE
316
 #endif // ADVANCE
316
 
317
 
321
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
322
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
322
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y E" // no z because of layer shift.
323
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y E" // no z because of layer shift.
323
 
324
 
324
-//#define ULTIPANEL
325
+#define ULTIPANEL
325
 #ifdef ULTIPANEL
326
 #ifdef ULTIPANEL
326
-  //#define NEWPANEL  //enable this if you have a click-encoder panel
327
-  #define SDSUPPORT
328
-  #define ULTRA_LCD
329
-  #define LCD_WIDTH 20
330
-  #define LCD_HEIGHT 4
327
+#define NEWPANEL  //enable this if you have a click-encoder panel
328
+#define SDSUPPORT
329
+#define ULTRA_LCD
330
+#define LCD_WIDTH 20
331
+#define LCD_HEIGHT 4
331
 #else //no panel but just lcd 
332
 #else //no panel but just lcd 
332
-  #ifdef ULTRA_LCD
333
-    #define LCD_WIDTH 16
334
-    #define LCD_HEIGHT 2
335
-  #endif
333
+#ifdef ULTRA_LCD
334
+#define LCD_WIDTH 16
335
+#define LCD_HEIGHT 2
336
+#endif
336
 #endif
337
 #endif
337
 
338
 
338
 // A debugging feature to compare calculated vs performed steps, to see if steps are lost by the software.
339
 // A debugging feature to compare calculated vs performed steps, to see if steps are lost by the software.
353
 // on an ultimaker, some initial testing worked with M109 S215 T260 F0.1 in the start.gcode
354
 // on an ultimaker, some initial testing worked with M109 S215 T260 F0.1 in the start.gcode
354
 //#define AUTOTEMP
355
 //#define AUTOTEMP
355
 #ifdef AUTOTEMP
356
 #ifdef AUTOTEMP
356
-  #define AUTOTEMP_OLDWEIGHT 0.98
357
+#define AUTOTEMP_OLDWEIGHT 0.98
357
 #endif
358
 #endif
358
 
359
 
359
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
360
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
360
 //can be software-disabled for whatever purposes by
361
 //can be software-disabled for whatever purposes by
361
 #define PREVENT_DANGEROUS_EXTRUDE
362
 #define PREVENT_DANGEROUS_EXTRUDE
362
-#define EXTRUDE_MINTEMP 190
363
+#define EXTRUDE_MINTEMP 0
363
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
364
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
364
 
365
 
365
 const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
366
 const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
378
 // The number of linear motions that can be in the plan at any give time.  
379
 // The number of linear motions that can be in the plan at any give time.  
379
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering.
380
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering.
380
 #if defined SDSUPPORT
381
 #if defined SDSUPPORT
381
-  #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
382
+#define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
382
 #else
383
 #else
383
-  #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
384
+#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
384
 #endif
385
 #endif
385
 
386
 
386
 
387
 
392
 #include "thermistortables.h"
393
 #include "thermistortables.h"
393
 
394
 
394
 #endif //__CONFIGURATION_H
395
 #endif //__CONFIGURATION_H
396
+
397
+

+ 3
- 1
Marlin/Marlin.pde Целия файл

237
 void setup_powerhold()
237
 void setup_powerhold()
238
 {
238
 {
239
  #ifdef SUICIDE_PIN
239
  #ifdef SUICIDE_PIN
240
+   #if (SUICIDE_PIN> -1)
240
       SET_OUTPUT(SUICIDE_PIN);
241
       SET_OUTPUT(SUICIDE_PIN);
241
       WRITE(SUICIDE_PIN, HIGH);
242
       WRITE(SUICIDE_PIN, HIGH);
242
-     #endif
243
+   #endif
244
+ #endif
243
 }
245
 }
244
 
246
 
245
 void suicide()
247
 void suicide()

+ 218
- 7
Marlin/ultralcd.pde Целия файл

527
           MENUITEM(  lcdprintPGM(" Main \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
527
           MENUITEM(  lcdprintPGM(" Main \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
528
           break;
528
           break;
529
           case ItemAM_X:
529
           case ItemAM_X:
530
-          MENUITEM(  lcdprintPGM(" X+")  ,  BLOCK;enquecommand("G92 X0");enquecommand("G1 F700 X10");beepshort(); ) ;
530
+         // MENUITEM(  lcdprintPGM(" X+")  ,  BLOCK;enquecommand("G92 X0");enquecommand("G1 F700 X10");beepshort(); ) ;
531
+         {
532
+                  if(force_lcd_update)
533
+                  {
534
+                    lcd.setCursor(0,line);lcdprintPGM(" X:");
535
+                    lcd.setCursor(13,line);lcd.print(ftostr3(current_position[X_AXIS]));
536
+                  }
537
+      
538
+                  if((activeline!=line) )
539
+                  break;
540
+                  
541
+                  if(CLICKED) 
542
+                  {
543
+                    linechanging=!linechanging;
544
+                    if(linechanging)
545
+                    {
546
+                        encoderpos=current_position[X_AXIS];
547
+                    }
548
+                    else
549
+                    {
550
+                      enquecommand("G1 F700 X"+encoderpos);
551
+                      encoderpos=activeline*lcdslow;
552
+                      beepshort();
553
+                    }
554
+                    BLOCK;
555
+                  }
556
+                  if(linechanging)
557
+                  {
558
+                    if(encoderpos<1) encoderpos=1;
559
+                    if(encoderpos>200) encoderpos=200;                   
560
+                    lcd.setCursor(13,line);lcd.print(current_position[X_AXIS]);
561
+                  }
562
+          }
531
           break;
563
           break;
532
           case ItemAM_Y:
564
           case ItemAM_Y:
533
-          MENUITEM(  lcdprintPGM(" Y+")  ,  BLOCK;enquecommand("G92 Y0");enquecommand("G1 F700 Y10");beepshort(); ) ;
565
+          //MENUITEM(  lcdprintPGM(" Y+")  ,  BLOCK;enquecommand("G92 Y0");enquecommand("G1 F700 Y10");beepshort(); ) ;
566
+          {
567
+                  if(force_lcd_update)
568
+                  {
569
+                    lcd.setCursor(0,line);lcdprintPGM(" Y:");
570
+                    lcd.setCursor(13,line);lcd.print(ftostr3(current_position[Y_AXIS]));
571
+                  }
572
+      
573
+                  if((activeline!=line) )
574
+                  break;
575
+                  
576
+                  if(CLICKED) 
577
+                  {
578
+                    linechanging=!linechanging;
579
+                    if(linechanging)
580
+                    {
581
+                        encoderpos=current_position[Y_AXIS];
582
+                    }
583
+                    else
584
+                    {
585
+                      enquecommand("G1 F700 Y"+encoderpos);
586
+                      encoderpos=activeline*lcdslow;
587
+                      beepshort();
588
+                    }
589
+                    BLOCK;
590
+                  }
591
+                  if(linechanging)
592
+                  {
593
+                    if(encoderpos<1) encoderpos=1;
594
+                    if(encoderpos>200) encoderpos=200;                   
595
+                    lcd.setCursor(13,line);lcd.print(current_position[Y_AXIS]);
596
+                  }
597
+          }
534
           break;
598
           break;
535
           case ItemAM_Z:
599
           case ItemAM_Z:
536
-          MENUITEM(  lcdprintPGM(" Z+")  ,  BLOCK;enquecommand("G92 Z0");enquecommand("G1 F700 Z10");beepshort(); ) ;
600
+          //MENUITEM(  lcdprintPGM(" Z+")  ,  BLOCK;enquecommand("G92 Z0");enquecommand("G1 F700 Z10");beepshort(); ) ;
601
+          {
602
+                  if(force_lcd_update)
603
+                  {
604
+                    lcd.setCursor(0,line);lcdprintPGM(" Z:");
605
+                    lcd.setCursor(13,line);lcd.print(ftostr3(current_position[Z_AXIS]));
606
+                  }
607
+      
608
+                  if((activeline!=line) )
609
+                  break;
610
+                  
611
+                  if(CLICKED) 
612
+                  {
613
+                    linechanging=!linechanging;
614
+                    if(linechanging)
615
+                    {
616
+                        encoderpos=current_position[Z_AXIS];
617
+                    }
618
+                    else
619
+                    {
620
+                      enquecommand("G1 F700 Z"+encoderpos);
621
+                      encoderpos=activeline*lcdslow;
622
+                      beepshort();
623
+                    }
624
+                    BLOCK;
625
+                  }
626
+                  if(linechanging)
627
+                  {
628
+                    if(encoderpos<1) encoderpos=1;
629
+                    if(encoderpos>170) encoderpos=170;                   
630
+                    lcd.setCursor(13,line);lcd.print(current_position[Z_AXIS]);
631
+                  }
632
+          }
537
           break;
633
           break;
538
           case ItemAM_E:
634
           case ItemAM_E:
539
-          MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
635
+          MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E10");beepshort(); ) ;
540
           break;
636
           break;
541
           default:
637
           default:
542
           break;
638
           break;
543
       }
639
       }
544
       line++;
640
       line++;
545
    }
641
    }
546
-   updateActiveLines(ItemAM_Z,encoderpos);
642
+   updateActiveLines(ItemAM_E,encoderpos);
547
 }
643
 }
548
 
644
 
549
 enum {ItemT_exit,ItemT_speed,ItemT_flow,ItemT_nozzle,
645
 enum {ItemT_exit,ItemT_speed,ItemT_flow,ItemT_nozzle,
1189
   ItemCM_vmaxx, ItemCM_vmaxy, ItemCM_vmaxz, ItemCM_vmaxe, 
1285
   ItemCM_vmaxx, ItemCM_vmaxy, ItemCM_vmaxz, ItemCM_vmaxe, 
1190
   ItemCM_vtravmin,ItemCM_vmin,  
1286
   ItemCM_vtravmin,ItemCM_vmin,  
1191
   ItemCM_amaxx, ItemCM_amaxy, ItemCM_amaxz, ItemCM_amaxe, 
1287
   ItemCM_amaxx, ItemCM_amaxy, ItemCM_amaxz, ItemCM_amaxe, 
1192
-  ItemCM_aret,ItemCM_esteps
1288
+  ItemCM_aret, ItemCM_xsteps,ItemCM_ysteps, ItemCM_zsteps, ItemCM_esteps
1193
 };
1289
 };
1194
 
1290
 
1195
 
1291
 
1465
         }
1561
         }
1466
         
1562
         
1467
       }break;
1563
       }break;
1564
+       case ItemCM_xsteps://axis_steps_per_unit[i] = code_value();
1565
+         {
1566
+      if(force_lcd_update)
1567
+        {
1568
+          lcd.setCursor(0,line);lcdprintPGM(" X steps/mm:");
1569
+          lcd.setCursor(13,line);lcd.print(itostr4(axis_steps_per_unit[0]));
1570
+        }
1571
+        
1572
+        if((activeline!=line) )
1573
+          break;
1574
+        
1575
+        if(CLICKED)
1576
+        {
1577
+          linechanging=!linechanging;
1578
+          if(linechanging)
1579
+          {
1580
+              encoderpos=(int)axis_steps_per_unit[0];
1581
+          }
1582
+          else
1583
+          {
1584
+            float factor=float(encoderpos)/float(axis_steps_per_unit[0]);
1585
+            position[X_AXIS]=lround(position[X_AXIS]*factor);
1586
+            //current_position[3]*=factor;
1587
+            axis_steps_per_unit[X_AXIS]= encoderpos;
1588
+            encoderpos=activeline*lcdslow;
1589
+              
1590
+          }
1591
+          BLOCK;
1592
+          beepshort();
1593
+        }
1594
+        if(linechanging)
1595
+        {
1596
+          if(encoderpos<5) encoderpos=5;
1597
+          if(encoderpos>9999) encoderpos=9999;
1598
+          lcd.setCursor(13,line);lcd.print(itostr4(encoderpos));
1599
+        }
1600
+        
1601
+      }break;
1602
+       case ItemCM_ysteps://axis_steps_per_unit[i] = code_value();
1603
+         {
1604
+      if(force_lcd_update)
1605
+        {
1606
+          lcd.setCursor(0,line);lcdprintPGM(" Y steps/mm:");
1607
+          lcd.setCursor(13,line);lcd.print(itostr4(axis_steps_per_unit[1]));
1608
+        }
1609
+        
1610
+        if((activeline!=line) )
1611
+          break;
1612
+        
1613
+        if(CLICKED)
1614
+        {
1615
+          linechanging=!linechanging;
1616
+          if(linechanging)
1617
+          {
1618
+              encoderpos=(int)axis_steps_per_unit[1];
1619
+          }
1620
+          else
1621
+          {
1622
+            float factor=float(encoderpos)/float(axis_steps_per_unit[1]);
1623
+            position[Y_AXIS]=lround(position[Y_AXIS]*factor);
1624
+            //current_position[3]*=factor;
1625
+            axis_steps_per_unit[Y_AXIS]= encoderpos;
1626
+            encoderpos=activeline*lcdslow;
1627
+              
1628
+          }
1629
+          BLOCK;
1630
+          beepshort();
1631
+        }
1632
+        if(linechanging)
1633
+        {
1634
+          if(encoderpos<5) encoderpos=5;
1635
+          if(encoderpos>9999) encoderpos=9999;
1636
+          lcd.setCursor(13,line);lcd.print(itostr4(encoderpos));
1637
+        }
1638
+        
1639
+      }break;
1640
+       case ItemCM_zsteps://axis_steps_per_unit[i] = code_value();
1641
+         {
1642
+      if(force_lcd_update)
1643
+        {
1644
+          lcd.setCursor(0,line);lcdprintPGM(" Z steps/mm:");
1645
+          lcd.setCursor(13,line);lcd.print(itostr4(axis_steps_per_unit[2]));
1646
+        }
1647
+        
1648
+        if((activeline!=line) )
1649
+          break;
1650
+        
1651
+        if(CLICKED)
1652
+        {
1653
+          linechanging=!linechanging;
1654
+          if(linechanging)
1655
+          {
1656
+              encoderpos=(int)axis_steps_per_unit[2];
1657
+          }
1658
+          else
1659
+          {
1660
+            float factor=float(encoderpos)/float(axis_steps_per_unit[2]);
1661
+            position[Z_AXIS]=lround(position[Z_AXIS]*factor);
1662
+            //current_position[3]*=factor;
1663
+            axis_steps_per_unit[Z_AXIS]= encoderpos;
1664
+            encoderpos=activeline*lcdslow;
1665
+              
1666
+          }
1667
+          BLOCK;
1668
+          beepshort();
1669
+        }
1670
+        if(linechanging)
1671
+        {
1672
+          if(encoderpos<5) encoderpos=5;
1673
+          if(encoderpos>9999) encoderpos=9999;
1674
+          lcd.setCursor(13,line);lcd.print(itostr4(encoderpos));
1675
+        }
1676
+        
1677
+      }break;
1678
+      
1468
     case ItemCM_esteps://axis_steps_per_unit[i] = code_value();
1679
     case ItemCM_esteps://axis_steps_per_unit[i] = code_value();
1469
          {
1680
          {
1470
       if(force_lcd_update)
1681
       if(force_lcd_update)
1471
         {
1682
         {
1472
-          lcd.setCursor(0,line);lcdprintPGM(" Esteps/mm:");
1683
+          lcd.setCursor(0,line);lcdprintPGM(" E steps/mm:");
1473
           lcd.setCursor(13,line);lcd.print(itostr4(axis_steps_per_unit[3]));
1684
           lcd.setCursor(13,line);lcd.print(itostr4(axis_steps_per_unit[3]));
1474
         }
1685
         }
1475
         
1686
         

Loading…
Отказ
Запис