Bladeren bron

Fixed HOME_POS in combination with G28 X0 or G28 Y0

Erik van der Zalm 13 jaren geleden
bovenliggende
commit
b4833d55c2
2 gewijzigde bestanden met toevoegingen van 15 en 6 verwijderingen
  1. 14
    5
      Marlin/Marlin.pde
  2. 1
    1
      Marlin/stepper.cpp

+ 14
- 5
Marlin/Marlin.pde Bestand weergeven

490
 { 
490
 { 
491
   return (strtod(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL)); 
491
   return (strtod(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL)); 
492
 }
492
 }
493
+
493
 long code_value_long() 
494
 long code_value_long() 
494
 { 
495
 { 
495
   return (strtol(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL, 10)); 
496
   return (strtol(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL, 10)); 
496
 }
497
 }
498
+
497
 bool code_seen(char code_string[]) //Return True if the string was found
499
 bool code_seen(char code_string[]) //Return True if the string was found
498
 { 
500
 { 
499
   return (strstr(cmdbuffer[bufindr], code_string) != NULL); 
501
   return (strstr(cmdbuffer[bufindr], code_string) != NULL); 
504
   strchr_pointer = strchr(cmdbuffer[bufindr], code);
506
   strchr_pointer = strchr(cmdbuffer[bufindr], code);
505
   return (strchr_pointer != NULL);  //Return True if a character was found
507
   return (strchr_pointer != NULL);  //Return True if a character was found
506
 }
508
 }
509
+
507
 #define HOMEAXIS(LETTER) \
510
 #define HOMEAXIS(LETTER) \
508
   if ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))\
511
   if ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))\
509
     { \
512
     { \
590
         feedrate = homing_feedrate[X_AXIS]; 
593
         feedrate = homing_feedrate[X_AXIS]; 
591
         if(homing_feedrate[Y_AXIS]<feedrate)
594
         if(homing_feedrate[Y_AXIS]<feedrate)
592
           feedrate =homing_feedrate[Y_AXIS]; 
595
           feedrate =homing_feedrate[Y_AXIS]; 
593
-        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
596
+        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
594
         st_synchronize();
597
         st_synchronize();
595
     
598
     
596
         current_position[X_AXIS] = (X_HOME_DIR == -1) ? X_HOME_POS : X_MAX_LENGTH;
599
         current_position[X_AXIS] = (X_HOME_DIR == -1) ? X_HOME_POS : X_MAX_LENGTH;
598
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
601
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
599
         destination[X_AXIS] = current_position[X_AXIS];
602
         destination[X_AXIS] = current_position[X_AXIS];
600
         destination[Y_AXIS] = current_position[Y_AXIS];
603
         destination[Y_AXIS] = current_position[Y_AXIS];
601
-        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
604
+        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
602
         feedrate = 0.0;
605
         feedrate = 0.0;
603
         st_synchronize();
606
         st_synchronize();
604
         endstops_hit_on_purpose();
607
         endstops_hit_on_purpose();
620
       
623
       
621
       if(code_seen(axis_codes[X_AXIS])) 
624
       if(code_seen(axis_codes[X_AXIS])) 
622
       {
625
       {
623
-        current_position[0]=code_value()+add_homeing[0];
626
+        if(code_value_long() != 0) {
627
+          current_position[X_AXIS]=code_value()+add_homeing[0];
628
+        }
624
       }
629
       }
625
 
630
 
626
       if(code_seen(axis_codes[Y_AXIS])) {
631
       if(code_seen(axis_codes[Y_AXIS])) {
627
-        current_position[1]=code_value()+add_homeing[1];
632
+        if(code_value_long() != 0) {
633
+          current_position[Y_AXIS]=code_value()+add_homeing[1];
634
+        }
628
       }
635
       }
629
 
636
 
630
       if(code_seen(axis_codes[Z_AXIS])) {
637
       if(code_seen(axis_codes[Z_AXIS])) {
631
-        current_position[2]=code_value()+add_homeing[2];
638
+        if(code_value_long() != 0) {
639
+          current_position[Z_AXIS]=code_value()+add_homeing[2];
640
+        }
632
       }
641
       }
633
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
642
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
634
       
643
       

+ 1
- 1
Marlin/stepper.cpp Bestand weergeven

432
       }
432
       }
433
       else { // +direction
433
       else { // +direction
434
         NORM_E_DIR();
434
         NORM_E_DIR();
435
-        count_direction[E_AXIS]=-1;
435
+        count_direction[E_AXIS]=1;
436
       }
436
       }
437
     #endif //!ADVANCE
437
     #endif //!ADVANCE
438
     
438
     

Laden…
Annuleren
Opslaan