Browse Source

Merge Servo Endstops (PR#2543)

Richard Wackerbarth 9 years ago
parent
commit
f9195d114b

+ 1
- 1
Marlin/Configuration.h View File

789
 //#define X_ENDSTOP_SERVO_NR 1
789
 //#define X_ENDSTOP_SERVO_NR 1
790
 //#define Y_ENDSTOP_SERVO_NR 2
790
 //#define Y_ENDSTOP_SERVO_NR 2
791
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
794
 // Servo deactivation
795
 //
795
 //

+ 8
- 10
Marlin/Marlin_main.cpp View File

316
 
316
 
317
 #ifdef SERVO_ENDSTOPS
317
 #ifdef SERVO_ENDSTOPS
318
   const int servo_endstops[] = SERVO_ENDSTOPS;
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
 #endif
320
 #endif
321
 
321
 
322
 #ifdef BARICUDA
322
 #ifdef BARICUDA
581
   #ifdef SERVO_ENDSTOPS
581
   #ifdef SERVO_ENDSTOPS
582
     for (int i = 0; i < 3; i++)
582
     for (int i = 0; i < 3; i++)
583
       if (servo_endstops[i] >= 0)
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
   #endif
585
   #endif
586
 
586
 
587
 }
587
 }
1325
     #ifdef SERVO_ENDSTOPS
1325
     #ifdef SERVO_ENDSTOPS
1326
 
1326
 
1327
       // Engage Z Servo endstop if enabled
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
     #elif defined(Z_PROBE_ALLEN_KEY)
1330
     #elif defined(Z_PROBE_ALLEN_KEY)
1331
       feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
1331
       feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
1425
         #endif
1425
         #endif
1426
 
1426
 
1427
         // Change the Z servo angle
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
     #elif defined(Z_PROBE_ALLEN_KEY)
1431
     #elif defined(Z_PROBE_ALLEN_KEY)
1677
     #endif
1677
     #endif
1678
 
1678
 
1679
     #ifdef SERVO_ENDSTOPS
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
     #endif
1683
     #endif
1686
 
1684
 
1687
     // Set a flag for Z motor locking
1685
     // Set a flag for Z motor locking
1783
       #ifdef SERVO_ENDSTOPS
1781
       #ifdef SERVO_ENDSTOPS
1784
         // Retract Servo endstop if enabled
1782
         // Retract Servo endstop if enabled
1785
         if (servo_endstops[axis] >= 0)
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
       #endif
1785
       #endif
1788
     }
1786
     }
1789
 
1787
 

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

789
 //#define X_ENDSTOP_SERVO_NR 1
789
 //#define X_ENDSTOP_SERVO_NR 1
790
 //#define Y_ENDSTOP_SERVO_NR 2
790
 //#define Y_ENDSTOP_SERVO_NR 2
791
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
794
 // Servo deactivation
795
 //
795
 //

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

767
 //#define X_ENDSTOP_SERVO_NR 1
767
 //#define X_ENDSTOP_SERVO_NR 1
768
 //#define Y_ENDSTOP_SERVO_NR 2
768
 //#define Y_ENDSTOP_SERVO_NR 2
769
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
772
 // Servo deactivation
773
 //
773
 //

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

719
 //#define X_ENDSTOP_SERVO_NR 1
719
 //#define X_ENDSTOP_SERVO_NR 1
720
 //#define Y_ENDSTOP_SERVO_NR 2
720
 //#define Y_ENDSTOP_SERVO_NR 2
721
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
724
 // Servo deactivation
725
 //
725
 //

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

776
 //#define X_ENDSTOP_SERVO_NR 1
776
 //#define X_ENDSTOP_SERVO_NR 1
777
 //#define Y_ENDSTOP_SERVO_NR 2
777
 //#define Y_ENDSTOP_SERVO_NR 2
778
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
781
 // Servo deactivation
782
 //
782
 //

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

772
 //#define X_ENDSTOP_SERVO_NR 1
772
 //#define X_ENDSTOP_SERVO_NR 1
773
 //#define Y_ENDSTOP_SERVO_NR 2
773
 //#define Y_ENDSTOP_SERVO_NR 2
774
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
777
 // Servo deactivation
778
 //
778
 //

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

784
 //#define X_ENDSTOP_SERVO_NR 1
784
 //#define X_ENDSTOP_SERVO_NR 1
785
 //#define Y_ENDSTOP_SERVO_NR 2
785
 //#define Y_ENDSTOP_SERVO_NR 2
786
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
789
 // Servo deactivation
790
 //
790
 //

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

767
 //#define X_ENDSTOP_SERVO_NR 1
767
 //#define X_ENDSTOP_SERVO_NR 1
768
 //#define Y_ENDSTOP_SERVO_NR 2
768
 //#define Y_ENDSTOP_SERVO_NR 2
769
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
772
 // Servo deactivation
773
 //
773
 //

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

792
 //#define X_ENDSTOP_SERVO_NR 1
792
 //#define X_ENDSTOP_SERVO_NR 1
793
 //#define Y_ENDSTOP_SERVO_NR 2
793
 //#define Y_ENDSTOP_SERVO_NR 2
794
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
797
 // Servo deactivation
798
 //
798
 //

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

776
 //#define X_ENDSTOP_SERVO_NR 1
776
 //#define X_ENDSTOP_SERVO_NR 1
777
 //#define Y_ENDSTOP_SERVO_NR 2
777
 //#define Y_ENDSTOP_SERVO_NR 2
778
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
781
 // Servo deactivation
782
 //
782
 //

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

784
 //#define X_ENDSTOP_SERVO_NR 1
784
 //#define X_ENDSTOP_SERVO_NR 1
785
 //#define Y_ENDSTOP_SERVO_NR 2
785
 //#define Y_ENDSTOP_SERVO_NR 2
786
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
789
 // Servo deactivation
790
 //
790
 //

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

907
 //#define X_ENDSTOP_SERVO_NR 1
907
 //#define X_ENDSTOP_SERVO_NR 1
908
 //#define Y_ENDSTOP_SERVO_NR 2
908
 //#define Y_ENDSTOP_SERVO_NR 2
909
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
912
 // Servo deactivation
913
 //
913
 //

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

911
 //#define X_ENDSTOP_SERVO_NR 1
911
 //#define X_ENDSTOP_SERVO_NR 1
912
 //#define Y_ENDSTOP_SERVO_NR 2
912
 //#define Y_ENDSTOP_SERVO_NR 2
913
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
916
 // Servo deactivation
917
 //
917
 //

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

911
 //#define X_ENDSTOP_SERVO_NR 1
911
 //#define X_ENDSTOP_SERVO_NR 1
912
 //#define Y_ENDSTOP_SERVO_NR 2
912
 //#define Y_ENDSTOP_SERVO_NR 2
913
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
916
 // Servo deactivation
917
 //
917
 //

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

906
 //#define X_ENDSTOP_SERVO_NR 1
906
 //#define X_ENDSTOP_SERVO_NR 1
907
 //#define Y_ENDSTOP_SERVO_NR 2
907
 //#define Y_ENDSTOP_SERVO_NR 2
908
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
911
 // Servo deactivation
912
 //
912
 //

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

787
 //#define X_ENDSTOP_SERVO_NR 1
787
 //#define X_ENDSTOP_SERVO_NR 1
788
 //#define Y_ENDSTOP_SERVO_NR 2
788
 //#define Y_ENDSTOP_SERVO_NR 2
789
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
792
 // Servo deactivation
793
 //
793
 //

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

778
 //#define X_ENDSTOP_SERVO_NR 1
778
 //#define X_ENDSTOP_SERVO_NR 1
779
 //#define Y_ENDSTOP_SERVO_NR 2
779
 //#define Y_ENDSTOP_SERVO_NR 2
780
 //#define Z_ENDSTOP_SERVO_NR 0
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
 // Servo deactivation
783
 // Servo deactivation
784
 //
784
 //

Loading…
Cancel
Save