Browse Source

repaired homing position setting.

Bernhard 13 years ago
parent
commit
460b788d78
1 changed files with 29 additions and 10 deletions
  1. 29
    10
      Marlin/Marlin.pde

+ 29
- 10
Marlin/Marlin.pde View File

539
       #ifdef QUICK_HOME
539
       #ifdef QUICK_HOME
540
       if( code_seen(axis_codes[0]) && code_seen(axis_codes[1]) )  //first diagonal move
540
       if( code_seen(axis_codes[0]) && code_seen(axis_codes[1]) )  //first diagonal move
541
       {
541
       {
542
-        current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
542
+        current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;  
543
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); 
543
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); 
544
-        destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;
545
-        destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR; 
546
-        feedrate =homing_feedrate[X_AXIS]; 
544
+        destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;  
545
+        feedrate = homing_feedrate[X_AXIS]; 
547
         if(homing_feedrate[Y_AXIS]<feedrate)
546
         if(homing_feedrate[Y_AXIS]<feedrate)
548
           feedrate =homing_feedrate[Y_AXIS]; 
547
           feedrate =homing_feedrate[Y_AXIS]; 
549
-        prepare_move();
550
-        current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
548
+        prepare_move(); 
549
+    
550
+        current_position[X_AXIS] = (X_HOME_DIR == -1) ? 0 : X_MAX_LENGTH;
551
+        current_position[Y_AXIS] = (Y_HOME_DIR == -1) ? 0 : Y_MAX_LENGTH;
552
+        plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
553
+        destination[X_AXIS] = current_position[X_AXIS];
554
+        destination[Y_AXIS] = current_position[Y_AXIS];
555
+        feedrate = 0.0;
556
+        st_synchronize();
557
+        plan_set_position(0, 0, current_position[Z_AXIS], current_position[E_AXIS]);
558
+        current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
559
+        endstops_hit_on_purpose();
551
       }
560
       }
552
       #endif
561
       #endif
553
       
562
       
554
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) 
563
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) 
555
       {
564
       {
556
         HOMEAXIS(X);
565
         HOMEAXIS(X);
557
-	current_position[0]=code_value()+add_homeing[0];
558
       }
566
       }
559
 
567
 
560
       if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
568
       if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
561
        HOMEAXIS(Y);
569
        HOMEAXIS(Y);
562
-       current_position[1]=code_value()+add_homeing[1];
563
       }
570
       }
564
 
571
 
565
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
572
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
566
         HOMEAXIS(Z);
573
         HOMEAXIS(Z);
567
-	current_position[2]=code_value()+add_homeing[2];
568
-      }       
574
+      }
575
+      
576
+      if(code_seen(axis_codes[X_AXIS])) 
577
+      {
578
+        current_position[0]=code_value()+add_homeing[0];
579
+      }
580
+
581
+      if(code_seen(axis_codes[Y_AXIS])) {
582
+       current_position[1]=code_value()+add_homeing[1];
583
+      }
584
+
585
+      if(code_seen(axis_codes[Z_AXIS])) {
586
+        current_position[2]=code_value()+add_homeing[2];
587
+      }
569
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
588
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
570
         enable_endstops(false);
589
         enable_endstops(false);
571
       #endif
590
       #endif

Loading…
Cancel
Save