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,8 +4,8 @@
4 4
 
5 5
 
6 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 9
 //#define BAUDRATE 230400
10 10
 
11 11
 #define EXTRUDERS 1
@@ -26,11 +26,11 @@
26 26
 // MEGA/RAMPS up to 1.2 = 3,
27 27
 // RAMPS 1.3 = 33
28 28
 // Gen6 = 5,
29
-// Sanguinololu 1.2 and above = 62,
30
-// Ultimaker = 7,
29
+// Sanguinololu 1.2 and above = 62
31 30
 // Gen7 = 77,
31
+// Ultimaker = 7,
32 32
 // Teensylu = 8
33
-#define MOTHERBOARD 7
33
+#define MOTHERBOARD 77
34 34
 
35 35
 //===========================================================================
36 36
 //=============================Thermal Settings  ============================
@@ -45,23 +45,23 @@
45 45
 // 6 is EPCOS 100k
46 46
 // 7 is 100k Honeywell thermistor 135-104LAG-J01
47 47
 
48
-//#define THERMISTORHEATER_0 3
48
+#define THERMISTORHEATER_0 1
49 49
 //#define THERMISTORHEATER_1 1
50 50
 //#define THERMISTORHEATER_2 1
51 51
 
52
-//#define HEATER_0_USES_THERMISTOR
52
+#define HEATER_0_USES_THERMISTOR
53 53
 //#define HEATER_1_USES_THERMISTOR
54 54
 //#define HEATER_2_USES_THERMISTOR
55
-#define HEATER_0_USES_AD595
55
+//#define HEATER_0_USES_AD595
56 56
 //#define HEATER_1_USES_AD595
57 57
 //#define HEATER_2_USES_AD595
58 58
 
59 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 62
 //#define BED_LIMIT_SWITCHING
63 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 65
 #endif
66 66
 //#define BED_USES_AD595
67 67
 
@@ -75,10 +75,10 @@
75 75
 
76 76
 // Actual temperature must be close to target for this long before M109 returns success
77 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 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 82
 //#define HEATER_1_MINTEMP 5
83 83
 //#define HEATER_2_MINTEMP 5
84 84
 //#define BED_MINTEMP 5
@@ -107,37 +107,37 @@
107 107
 #define PIDTEMP
108 108
 #define PID_MAX 255 // limits current to nozzle; 255=full current
109 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 133
 //    #define  DEFAULT_Kp  (0.6*PID_CRITIAL_GAIN)
134 134
 //    #define  DEFAULT_Ki (2*Kp/PID_SWING_AT_CRITIAL*PID_dT)  
135 135
 //    #define  DEFAULT_Kd (PID_SWING_AT_CRITIAL/8./PID_dT)  
136 136
 
137 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 142
 // Makergear
143 143
 //    #define  DEFAULT_Kp 7.0
@@ -148,21 +148,21 @@
148 148
 //    #define  DEFAULT_Kp  63.0
149 149
 //    #define  DEFAULT_Ki (2.25*PID_dT)  
150 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 166
 #endif // PIDTEMP
167 167
 
168 168
 //  extruder run-out prevention. 
@@ -184,9 +184,9 @@
184 184
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
185 185
 
186 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 190
 // For optos H21LOB set to true, for Mendel-Parts newer optos TCST2103 set to false
191 191
 
192 192
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
@@ -209,9 +209,9 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
209 209
 //#define INVERT_Z_DIR false    // for Mendel set to false, for Orca set to true
210 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 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 215
 #define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
216 216
 #define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
217 217
 #define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
@@ -256,7 +256,8 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
256 256
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
257 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 261
 #define DEFAULT_MINSEGMENTTIME        20000   // Obsolete delete this
261 262
 #define DEFAULT_XYJERK                20.0    // (mm/sec)
262 263
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
@@ -290,7 +291,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
290 291
 // this enables the watchdog interrupt.
291 292
 //#define USE_WATCHDOG
292 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 295
 //#define RESET_MANUAL
295 296
 //#define WATCHDOG_TIMEOUT 4  //seconds
296 297
 //#endif
@@ -305,12 +306,12 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
305 306
 //#define ADVANCE
306 307
 
307 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 316
 #endif // ADVANCE
316 317
 
@@ -321,18 +322,18 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
321 322
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
322 323
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y E" // no z because of layer shift.
323 324
 
324
-//#define ULTIPANEL
325
+#define ULTIPANEL
325 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 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 337
 #endif
337 338
 
338 339
 // A debugging feature to compare calculated vs performed steps, to see if steps are lost by the software.
@@ -353,13 +354,13 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
353 354
 // on an ultimaker, some initial testing worked with M109 S215 T260 F0.1 in the start.gcode
354 355
 //#define AUTOTEMP
355 356
 #ifdef AUTOTEMP
356
-  #define AUTOTEMP_OLDWEIGHT 0.98
357
+#define AUTOTEMP_OLDWEIGHT 0.98
357 358
 #endif
358 359
 
359 360
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
360 361
 //can be software-disabled for whatever purposes by
361 362
 #define PREVENT_DANGEROUS_EXTRUDE
362
-#define EXTRUDE_MINTEMP 190
363
+#define EXTRUDE_MINTEMP 0
363 364
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
364 365
 
365 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,9 +379,9 @@ const int dropsegments=5; //everything with less than this number of steps will
378 379
 // The number of linear motions that can be in the plan at any give time.  
379 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 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 383
 #else
383
-  #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
384
+#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
384 385
 #endif
385 386
 
386 387
 
@@ -392,3 +393,5 @@ const int dropsegments=5; //everything with less than this number of steps will
392 393
 #include "thermistortables.h"
393 394
 
394 395
 #endif //__CONFIGURATION_H
396
+
397
+

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

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

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

@@ -527,23 +527,119 @@ void MainMenu::showAxisMove()
527 527
           MENUITEM(  lcdprintPGM(" Main \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
528 528
           break;
529 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 563
           break;
532 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 598
           break;
535 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 633
           break;
538 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 636
           break;
541 637
           default:
542 638
           break;
543 639
       }
544 640
       line++;
545 641
    }
546
-   updateActiveLines(ItemAM_Z,encoderpos);
642
+   updateActiveLines(ItemAM_E,encoderpos);
547 643
 }
548 644
 
549 645
 enum {ItemT_exit,ItemT_speed,ItemT_flow,ItemT_nozzle,
@@ -1189,7 +1285,7 @@ enum {
1189 1285
   ItemCM_vmaxx, ItemCM_vmaxy, ItemCM_vmaxz, ItemCM_vmaxe, 
1190 1286
   ItemCM_vtravmin,ItemCM_vmin,  
1191 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,11 +1561,126 @@ void MainMenu::showControlMotion()
1465 1561
         }
1466 1562
         
1467 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 1679
     case ItemCM_esteps://axis_steps_per_unit[i] = code_value();
1469 1680
          {
1470 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 1684
           lcd.setCursor(13,line);lcd.print(itostr4(axis_steps_per_unit[3]));
1474 1685
         }
1475 1686
         

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