Erik van der Zalm 13 lat temu
rodzic
commit
b48d67ce10
4 zmienionych plików z 32 dodań i 17 usunięć
  1. 18
    2
      Marlin/Marlin.pde
  2. 12
    0
      Marlin/motion_control.cpp
  3. 0
    13
      Marlin/planner.cpp
  4. 2
    2
      Marlin/temperature.cpp

+ 18
- 2
Marlin/Marlin.pde Wyświetl plik

@@ -513,20 +513,22 @@ bool code_seen(char code)
513 513
     destination[LETTER##_AXIS] = 1.5 * LETTER##_MAX_LENGTH * LETTER##_HOME_DIR; \
514 514
     feedrate = homing_feedrate[LETTER##_AXIS]; \
515 515
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
516
+    st_synchronize();\
516 517
     \
517 518
     current_position[LETTER##_AXIS] = 0;\
518 519
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);\
519 520
     destination[LETTER##_AXIS] = -LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\
520 521
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
522
+    st_synchronize();\
521 523
     \
522 524
     destination[LETTER##_AXIS] = 2*LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\
523 525
     feedrate = homing_feedrate[LETTER##_AXIS]/2 ;  \
524 526
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
527
+    st_synchronize();\
525 528
     \
526 529
     current_position[LETTER##_AXIS] = (LETTER##_HOME_DIR == -1) ? LETTER##_HOME_POS : LETTER##_MAX_LENGTH;\
527 530
     destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\
528 531
     feedrate = 0.0;\
529
-    st_synchronize();\
530 532
     endstops_hit_on_purpose();\
531 533
   }
532 534
 
@@ -589,13 +591,15 @@ void process_commands()
589 591
         feedrate = homing_feedrate[X_AXIS]; 
590 592
         if(homing_feedrate[Y_AXIS]<feedrate)
591 593
           feedrate =homing_feedrate[Y_AXIS]; 
592
-        prepare_move(); 
594
+        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
595
+        st_synchronize();
593 596
     
594 597
         current_position[X_AXIS] = (X_HOME_DIR == -1) ? X_HOME_POS : X_MAX_LENGTH;
595 598
         current_position[Y_AXIS] = (Y_HOME_DIR == -1) ? Y_HOME_POS : Y_MAX_LENGTH;
596 599
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
597 600
         destination[X_AXIS] = current_position[X_AXIS];
598 601
         destination[Y_AXIS] = current_position[Y_AXIS];
602
+        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
599 603
         feedrate = 0.0;
600 604
         st_synchronize();
601 605
         endstops_hit_on_purpose();
@@ -1273,6 +1277,18 @@ void get_arc_coordinates()
1273 1277
 
1274 1278
 void prepare_move()
1275 1279
 {
1280
+  if (min_software_endstops) {
1281
+    if (destination[X_AXIS] < X_HOME_POS) destination[X_AXIS] = X_HOME_POS;
1282
+    if (destination[Y_AXIS] < Y_HOME_POS) destination[Y_AXIS] = Y_HOME_POS;
1283
+    if (destination[Z_AXIS] < Z_HOME_POS) destination[Z_AXIS] = Z_HOME_POS;
1284
+  }
1285
+
1286
+  if (max_software_endstops) {
1287
+    if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH;
1288
+    if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH;
1289
+    if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH;
1290
+  }
1291
+  
1276 1292
   plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder);
1277 1293
   for(int8_t i=0; i < NUM_AXIS; i++) {
1278 1294
     current_position[i] = destination[i];

+ 12
- 0
Marlin/motion_control.cpp Wyświetl plik

@@ -122,6 +122,18 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8
122 122
     arc_target[axis_1] = center_axis1 + r_axis1;
123 123
     arc_target[axis_linear] += linear_per_segment;
124 124
     arc_target[E_AXIS] += extruder_per_segment;
125
+
126
+    if (min_software_endstops) {
127
+      if (arc_target[X_AXIS] < X_HOME_POS) arc_target[X_AXIS] = X_HOME_POS;
128
+      if (arc_target[Y_AXIS] < Y_HOME_POS) arc_target[Y_AXIS] = Y_HOME_POS;
129
+      if (arc_target[Z_AXIS] < Z_HOME_POS) arc_target[Z_AXIS] = Z_HOME_POS;
130
+    }
131
+
132
+    if (max_software_endstops) {
133
+      if (arc_target[X_AXIS] > X_MAX_LENGTH) arc_target[X_AXIS] = X_MAX_LENGTH;
134
+      if (arc_target[Y_AXIS] > Y_MAX_LENGTH) arc_target[Y_AXIS] = Y_MAX_LENGTH;
135
+      if (arc_target[Z_AXIS] > Z_MAX_LENGTH) arc_target[Z_AXIS] = Z_MAX_LENGTH;
136
+    }
125 137
     plan_buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], feed_rate, extruder);
126 138
     
127 139
   }

+ 0
- 13
Marlin/planner.cpp Wyświetl plik

@@ -446,19 +446,6 @@ void plan_buffer_line(float &x, float &y, float &z, float &e, float feed_rate, u
446 446
   // Calculate the buffer head after we push this byte
447 447
   int next_buffer_head = next_block_index(block_buffer_head);
448 448
 
449
-  
450
-  if (min_software_endstops) {
451
-    if (x < X_HOME_POS) x = X_HOME_POS;
452
-    if (y < Y_HOME_POS) y = Y_HOME_POS;
453
-    if (z < Z_HOME_POS) z = Z_HOME_POS;
454
-  }
455
-
456
-  if (max_software_endstops) {
457
-    if (x > X_MAX_LENGTH) x = X_MAX_LENGTH;
458
-    if (y > Y_MAX_LENGTH) y = Y_MAX_LENGTH;
459
-    if (z > Z_MAX_LENGTH) z = Z_MAX_LENGTH;
460
-  }
461
-  
462 449
   // If the buffer is full: good! That means we are well ahead of the robot. 
463 450
   // Rest here until there is room in the buffer.
464 451
   while(block_buffer_tail == next_buffer_head) { 

+ 2
- 2
Marlin/temperature.cpp Wyświetl plik

@@ -851,18 +851,18 @@ ISR(TIMER0_COMPB_vect)
851 851
     for(unsigned char e = 0; e < EXTRUDERS; e++) {
852 852
        if(current_raw[e] >= maxttemp[e]) {
853 853
           target_raw[e] = 0;
854
+          max_temp_error(e);
854 855
           #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
855 856
           {
856
-            max_temp_error(e);
857 857
             kill();;
858 858
           }
859 859
           #endif
860 860
        }
861 861
        if(current_raw[e] <= minttemp[e]) {
862 862
           target_raw[e] = 0;
863
+          min_temp_error(e);
863 864
           #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
864 865
           {
865
-            min_temp_error(e);
866 866
             kill();
867 867
           }
868 868
           #endif

Ładowanie…
Anuluj
Zapisz