Browse Source

Fixed move from panel for delta bot #557

Nicolas Rossi 12 years ago
parent
commit
55c287a69e
3 changed files with 25 additions and 3 deletions
  1. 1
    0
      Marlin/Marlin.h
  2. 4
    3
      Marlin/Marlin_main.cpp
  3. 20
    0
      Marlin/ultralcd.cpp

+ 1
- 0
Marlin/Marlin.h View File

@@ -163,6 +163,7 @@ void ClearToSend();
163 163
 void get_coordinates();
164 164
 #ifdef DELTA
165 165
 void calculate_delta(float cartesian[3]);
166
+extern float delta[3];
166 167
 #endif
167 168
 void prepare_move();
168 169
 void kill();

+ 4
- 3
Marlin/Marlin_main.cpp View File

@@ -198,14 +198,15 @@ int EtoPPressure=0;
198 198
 	bool powersupply = true;
199 199
 #endif
200 200
 
201
+#ifdef DELTA
202
+float delta[3] = {0.0, 0.0, 0.0};
203
+#endif
204
+
201 205
 //===========================================================================
202 206
 //=============================private variables=============================
203 207
 //===========================================================================
204 208
 const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
205 209
 static float destination[NUM_AXIS] = {  0.0, 0.0, 0.0, 0.0};
206
-#ifdef DELTA
207
-static float delta[3] = {0.0, 0.0, 0.0};
208
-#endif
209 210
 static float offset[3] = {0.0, 0.0, 0.0};
210 211
 static bool home_all_axis = true;
211 212
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;

+ 20
- 0
Marlin/ultralcd.cpp View File

@@ -374,7 +374,12 @@ static void lcd_move_x()
374 374
         if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
375 375
             current_position[X_AXIS] = X_MAX_POS;
376 376
         encoderPosition = 0;
377
+        #ifdef DELTA
378
+        calculate_delta(current_position);
379
+        plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
380
+        #else
377 381
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
382
+        #endif
378 383
         lcdDrawUpdate = 1;
379 384
     }
380 385
     if (lcdDrawUpdate)
@@ -398,7 +403,12 @@ static void lcd_move_y()
398 403
         if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
399 404
             current_position[Y_AXIS] = Y_MAX_POS;
400 405
         encoderPosition = 0;
406
+        #ifdef DELTA
407
+        calculate_delta(current_position);
408
+        plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
409
+        #else
401 410
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
411
+        #endif
402 412
         lcdDrawUpdate = 1;
403 413
     }
404 414
     if (lcdDrawUpdate)
@@ -422,7 +432,12 @@ static void lcd_move_z()
422 432
         if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
423 433
             current_position[Z_AXIS] = Z_MAX_POS;
424 434
         encoderPosition = 0;
435
+        #ifdef DELTA
436
+        calculate_delta(current_position);
437
+        plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
438
+        #else
425 439
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
440
+        #endif
426 441
         lcdDrawUpdate = 1;
427 442
     }
428 443
     if (lcdDrawUpdate)
@@ -442,7 +457,12 @@ static void lcd_move_e()
442 457
     {
443 458
         current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
444 459
         encoderPosition = 0;
460
+        #ifdef DELTA
461
+        calculate_delta(current_position);
462
+        plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], 20, active_extruder);
463
+        #else
445 464
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 20, active_extruder);
465
+        #endif
446 466
         lcdDrawUpdate = 1;
447 467
     }
448 468
     if (lcdDrawUpdate)

Loading…
Cancel
Save