Browse Source

Merge Servo Endstops (PR#2543)

Richard Wackerbarth 9 years ago
parent
commit
f9195d114b

+ 1
- 1
Marlin/Configuration.h View File

@@ -789,7 +789,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
789 789
 //#define X_ENDSTOP_SERVO_NR 1
790 790
 //#define Y_ENDSTOP_SERVO_NR 2
791 791
 //#define Z_ENDSTOP_SERVO_NR 0
792
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
792
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
793 793
 
794 794
 // Servo deactivation
795 795
 //

+ 8
- 10
Marlin/Marlin_main.cpp View File

@@ -316,7 +316,7 @@ bool target_direction;
316 316
 
317 317
 #ifdef SERVO_ENDSTOPS
318 318
   const int servo_endstops[] = SERVO_ENDSTOPS;
319
-  const int servo_endstop_angles[] = SERVO_ENDSTOP_ANGLES;
319
+  const int servo_endstop_angles[][] = SERVO_ENDSTOP_ANGLES;
320 320
 #endif
321 321
 
322 322
 #ifdef BARICUDA
@@ -581,7 +581,7 @@ void servo_init() {
581 581
   #ifdef SERVO_ENDSTOPS
582 582
     for (int i = 0; i < 3; i++)
583 583
       if (servo_endstops[i] >= 0)
584
-        servo[servo_endstops[i]].move(servo_endstop_angles[i * 2 + 1]);
584
+        servo[servo_endstops[i]].move(servo_endstop_angles[i][1]);
585 585
   #endif
586 586
 
587 587
 }
@@ -1325,7 +1325,7 @@ static void setup_for_endstop_move() {
1325 1325
     #ifdef SERVO_ENDSTOPS
1326 1326
 
1327 1327
       // Engage Z Servo endstop if enabled
1328
-      if (servo_endstops[Z_AXIS] >= 0) servo[servo_endstops[Z_AXIS]].move(servo_endstop_angles[Z_AXIS * 2]);
1328
+      if (servo_endstops[Z_AXIS] >= 0) servo[servo_endstops[Z_AXIS]].move(servo_endstop_angles[Z_AXIS][0]);
1329 1329
 
1330 1330
     #elif defined(Z_PROBE_ALLEN_KEY)
1331 1331
       feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
@@ -1425,7 +1425,7 @@ static void setup_for_endstop_move() {
1425 1425
         #endif
1426 1426
 
1427 1427
         // Change the Z servo angle
1428
-        servo[servo_endstops[Z_AXIS]].move(servo_endstop_angles[Z_AXIS * 2 + 1]);
1428
+        servo[servo_endstops[Z_AXIS]].move(servo_endstop_angles[Z_AXIS][1]);
1429 1429
       }
1430 1430
 
1431 1431
     #elif defined(Z_PROBE_ALLEN_KEY)
@@ -1677,11 +1677,9 @@ static void homeaxis(AxisEnum axis) {
1677 1677
     #endif
1678 1678
 
1679 1679
     #ifdef SERVO_ENDSTOPS
1680
-      if (axis != Z_AXIS) {
1681
-        // Engage Servo endstop if enabled
1682
-        if (servo_endstops[axis] >= 0) 
1683
-          servo[servo_endstops[axis]].move(servo_endstop_angles[axis * 2]);
1684
-      }
1680
+      // Engage Servo endstop if enabled
1681
+      if (axis != Z_AXIS && servo_endstops[axis] >= 0)
1682
+        servo[servo_endstops[axis]].move(servo_endstop_angles[axis][0]);
1685 1683
     #endif
1686 1684
 
1687 1685
     // Set a flag for Z motor locking
@@ -1783,7 +1781,7 @@ static void homeaxis(AxisEnum axis) {
1783 1781
       #ifdef SERVO_ENDSTOPS
1784 1782
         // Retract Servo endstop if enabled
1785 1783
         if (servo_endstops[axis] >= 0)
1786
-          servo[servo_endstops[axis]].move(servo_endstop_angles[axis * 2 + 1]);
1784
+          servo[servo_endstops[axis]].move(servo_endstop_angles[axis][1]);
1787 1785
       #endif
1788 1786
     }
1789 1787
 

+ 1
- 1
Marlin/configurator/config/Configuration.h View File

@@ -789,7 +789,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
789 789
 //#define X_ENDSTOP_SERVO_NR 1
790 790
 //#define Y_ENDSTOP_SERVO_NR 2
791 791
 //#define Z_ENDSTOP_SERVO_NR 0
792
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
792
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
793 793
 
794 794
 // Servo deactivation
795 795
 //

+ 1
- 1
Marlin/example_configurations/Felix/Configuration.h View File

@@ -767,7 +767,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
767 767
 //#define X_ENDSTOP_SERVO_NR 1
768 768
 //#define Y_ENDSTOP_SERVO_NR 2
769 769
 //#define Z_ENDSTOP_SERVO_NR 0
770
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
770
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
771 771
 
772 772
 // Servo deactivation
773 773
 //

+ 1
- 1
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -719,7 +719,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
719 719
 //#define X_ENDSTOP_SERVO_NR 1
720 720
 //#define Y_ENDSTOP_SERVO_NR 2
721 721
 //#define Z_ENDSTOP_SERVO_NR 0
722
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
722
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
723 723
 
724 724
 // Servo deactivation
725 725
 //

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -776,7 +776,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
776 776
 //#define X_ENDSTOP_SERVO_NR 1
777 777
 //#define Y_ENDSTOP_SERVO_NR 2
778 778
 //#define Z_ENDSTOP_SERVO_NR 0
779
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
779
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
780 780
 
781 781
 // Servo deactivation
782 782
 //

+ 1
- 1
Marlin/example_configurations/K8200/Configuration.h View File

@@ -772,7 +772,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
772 772
 //#define X_ENDSTOP_SERVO_NR 1
773 773
 //#define Y_ENDSTOP_SERVO_NR 2
774 774
 //#define Z_ENDSTOP_SERVO_NR 0
775
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
775
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
776 776
 
777 777
 // Servo deactivation
778 778
 //

+ 1
- 1
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

@@ -784,7 +784,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
784 784
 //#define X_ENDSTOP_SERVO_NR 1
785 785
 //#define Y_ENDSTOP_SERVO_NR 2
786 786
 //#define Z_ENDSTOP_SERVO_NR 0
787
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
787
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
788 788
 
789 789
 // Servo deactivation
790 790
 //

+ 1
- 1
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -767,7 +767,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
767 767
 //#define X_ENDSTOP_SERVO_NR 1
768 768
 //#define Y_ENDSTOP_SERVO_NR 2
769 769
 //#define Z_ENDSTOP_SERVO_NR 0
770
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
770
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
771 771
 
772 772
 // Servo deactivation
773 773
 //

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -792,7 +792,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
792 792
 //#define X_ENDSTOP_SERVO_NR 1
793 793
 //#define Y_ENDSTOP_SERVO_NR 2
794 794
 //#define Z_ENDSTOP_SERVO_NR 0
795
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
795
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
796 796
 
797 797
 // Servo deactivation
798 798
 //

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -776,7 +776,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
776 776
 //#define X_ENDSTOP_SERVO_NR 1
777 777
 //#define Y_ENDSTOP_SERVO_NR 2
778 778
 //#define Z_ENDSTOP_SERVO_NR 0
779
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
779
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
780 780
 
781 781
 // Servo deactivation
782 782
 //

+ 1
- 1
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

@@ -784,7 +784,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
784 784
 //#define X_ENDSTOP_SERVO_NR 1
785 785
 //#define Y_ENDSTOP_SERVO_NR 2
786 786
 //#define Z_ENDSTOP_SERVO_NR 0
787
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
787
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
788 788
 
789 789
 // Servo deactivation
790 790
 //

+ 1
- 1
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

@@ -907,7 +907,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
907 907
 //#define X_ENDSTOP_SERVO_NR 1
908 908
 //#define Y_ENDSTOP_SERVO_NR 2
909 909
 //#define Z_ENDSTOP_SERVO_NR 0
910
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
910
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
911 911
 
912 912
 // Servo deactivation
913 913
 //

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -911,7 +911,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
911 911
 //#define X_ENDSTOP_SERVO_NR 1
912 912
 //#define Y_ENDSTOP_SERVO_NR 2
913 913
 //#define Z_ENDSTOP_SERVO_NR 0
914
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
914
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
915 915
 
916 916
 // Servo deactivation
917 917
 //

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -911,7 +911,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
911 911
 //#define X_ENDSTOP_SERVO_NR 1
912 912
 //#define Y_ENDSTOP_SERVO_NR 2
913 913
 //#define Z_ENDSTOP_SERVO_NR 0
914
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
914
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
915 915
 
916 916
 // Servo deactivation
917 917
 //

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -906,7 +906,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
906 906
 //#define X_ENDSTOP_SERVO_NR 1
907 907
 //#define Y_ENDSTOP_SERVO_NR 2
908 908
 //#define Z_ENDSTOP_SERVO_NR 0
909
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
909
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
910 910
 
911 911
 // Servo deactivation
912 912
 //

+ 1
- 1
Marlin/example_configurations/makibox/Configuration.h View File

@@ -787,7 +787,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
787 787
 //#define X_ENDSTOP_SERVO_NR 1
788 788
 //#define Y_ENDSTOP_SERVO_NR 2
789 789
 //#define Z_ENDSTOP_SERVO_NR 0
790
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
790
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
791 791
 
792 792
 // Servo deactivation
793 793
 //

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -778,7 +778,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
778 778
 //#define X_ENDSTOP_SERVO_NR 1
779 779
 //#define Y_ENDSTOP_SERVO_NR 2
780 780
 //#define Z_ENDSTOP_SERVO_NR 0
781
-//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
781
+//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
782 782
 
783 783
 // Servo deactivation
784 784
 //

Loading…
Cancel
Save