Browse Source

Add support for SOLENOID_PROBE

Scott Lahteine 7 years ago
parent
commit
fd2a0784ba
27 changed files with 102 additions and 8 deletions
  1. 1
    1
      Marlin/Conditionals_LCD.h
  2. 3
    0
      Marlin/Configuration.h
  3. 13
    7
      Marlin/Marlin_main.cpp
  4. 16
    0
      Marlin/SanityCheck.h
  5. 3
    0
      Marlin/example_configurations/Cartesio/Configuration.h
  6. 3
    0
      Marlin/example_configurations/Felix/Configuration.h
  7. 3
    0
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  8. 3
    0
      Marlin/example_configurations/Hephestos/Configuration.h
  9. 3
    0
      Marlin/example_configurations/Hephestos_2/Configuration.h
  10. 3
    0
      Marlin/example_configurations/K8200/Configuration.h
  11. 3
    0
      Marlin/example_configurations/K8400/Configuration.h
  12. 3
    0
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  13. 3
    0
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  14. 3
    0
      Marlin/example_configurations/RigidBot/Configuration.h
  15. 3
    0
      Marlin/example_configurations/SCARA/Configuration.h
  16. 3
    0
      Marlin/example_configurations/TAZ4/Configuration.h
  17. 3
    0
      Marlin/example_configurations/TinyBoy2/Configuration.h
  18. 3
    0
      Marlin/example_configurations/WITBOX/Configuration.h
  19. 3
    0
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  20. 3
    0
      Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h
  21. 3
    0
      Marlin/example_configurations/delta/generic/Configuration.h
  22. 3
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  23. 3
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  24. 3
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  25. 3
    0
      Marlin/example_configurations/makibox/Configuration.h
  26. 3
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  27. 3
    0
      Marlin/example_configurations/wt150/Configuration.h

+ 1
- 1
Marlin/Conditionals_LCD.h View File

@@ -374,7 +374,7 @@
374 374
   /**
375 375
    * Set a flag for any enabled probe
376 376
    */
377
-  #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))
377
+  #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE))
378 378
 
379 379
   /**
380 380
    * Clear probe pin settings when no probe is selected

+ 3
- 0
Marlin/Configuration.h View File

@@ -593,6 +593,9 @@
593 593
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
594 594
  */
595 595
 
596
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
597
+//#define SOLENOID_PROBE
598
+
596 599
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
597 600
 //#define Z_PROBE_SLED
598 601
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 13
- 7
Marlin/Marlin_main.cpp View File

@@ -1854,8 +1854,8 @@ static void clean_up_after_endstop_or_probe_move() {
1854 1854
     // Dock sled a bit closer to ensure proper capturing
1855 1855
     do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0));
1856 1856
 
1857
-    #if PIN_EXISTS(SLED)
1858
-      digitalWrite(SLED_PIN, !stow); // switch solenoid
1857
+    #if HAS_SOLENOID_1 && DISABLED(EXT_SOLENOID)
1858
+      WRITE(SOL1_PIN, !stow); // switch solenoid
1859 1859
     #endif
1860 1860
   }
1861 1861
 
@@ -2123,7 +2123,13 @@ static void clean_up_after_endstop_or_probe_move() {
2123 2123
                                                      // otherwise an Allen-Key probe can't be stowed.
2124 2124
     #endif
2125 2125
 
2126
-        #if ENABLED(Z_PROBE_SLED)
2126
+        #if ENABLED(SOLENOID_PROBE)
2127
+
2128
+          #if HAS_SOLENOID_1
2129
+            WRITE(SOL1_PIN, deploy);
2130
+          #endif
2131
+
2132
+        #elif ENABLED(Z_PROBE_SLED)
2127 2133
 
2128 2134
           dock_sled(!deploy);
2129 2135
 
@@ -7588,7 +7594,7 @@ inline void gcode_M303() {
7588 7594
 
7589 7595
 #if ENABLED(EXT_SOLENOID)
7590 7596
 
7591
-  void enable_solenoid(uint8_t num) {
7597
+  void enable_solenoid(const uint8_t num) {
7592 7598
     switch (num) {
7593 7599
       case 0:
7594 7600
         OUT_WRITE(SOL0_PIN, HIGH);
@@ -11437,9 +11443,9 @@ void setup() {
11437 11443
     dac_init();
11438 11444
   #endif
11439 11445
 
11440
-  #if ENABLED(Z_PROBE_SLED) && PIN_EXISTS(SLED)
11441
-    OUT_WRITE(SLED_PIN, LOW); // turn it off
11442
-  #endif // Z_PROBE_SLED
11446
+  #if (ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) && HAS_SOLENOID_1
11447
+    OUT_WRITE(SOL1_PIN, LOW); // turn it off
11448
+  #endif
11443 11449
 
11444 11450
   setup_homepin();
11445 11451
 

+ 16
- 0
Marlin/SanityCheck.h View File

@@ -172,6 +172,8 @@
172 172
   #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
173 173
 #elif defined(min_software_endstops) || defined(max_software_endstops)
174 174
   #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."
175
+#elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
176
+  #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
175 177
 #endif
176 178
 
177 179
 /**
@@ -459,6 +461,9 @@ static_assert(1 >= 0
459 461
   #if ENABLED(Z_PROBE_SLED)
460 462
     + 1
461 463
   #endif
464
+  #if ENABLED(SOLENOID_PROBE)
465
+    + 1
466
+  #endif
462 467
   , "Please enable only one probe: PROBE_MANUALLY, FIX_MOUNTED_PROBE, Z Servo, BLTOUCH, Z_PROBE_ALLEN_KEY, or Z_PROBE_SLED."
463 468
 );
464 469
 
@@ -473,6 +478,17 @@ static_assert(1 >= 0
473 478
   #endif
474 479
 
475 480
   /**
481
+   * SOLENOID_PROBE requirements
482
+   */
483
+  #if ENABLED(SOLENOID_PROBE)
484
+    #if ENABLED(EXT_SOLENOID)
485
+      #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
486
+    #elif !HAS_SOLENOID_1
487
+      #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h."
488
+    #endif
489
+  #endif
490
+
491
+  /**
476 492
    * NUM_SERVOS is required for a Z servo probe
477 493
    */
478 494
   #if HAS_Z_SERVO_ENDSTOP

+ 3
- 0
Marlin/example_configurations/Cartesio/Configuration.h View File

@@ -592,6 +592,9 @@
592 592
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
593 593
  */
594 594
 
595
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
596
+//#define SOLENOID_PROBE
597
+
595 598
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
596 599
 //#define Z_PROBE_SLED
597 600
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/Felix/Configuration.h View File

@@ -576,6 +576,9 @@
576 576
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
577 577
  */
578 578
 
579
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
580
+//#define SOLENOID_PROBE
581
+
579 582
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
580 583
 //#define Z_PROBE_SLED
581 584
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

@@ -576,6 +576,9 @@
576 576
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
577 577
  */
578 578
 
579
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
580
+//#define SOLENOID_PROBE
581
+
579 582
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
580 583
 //#define Z_PROBE_SLED
581 584
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -584,6 +584,9 @@
584 584
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
585 585
  */
586 586
 
587
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
588
+//#define SOLENOID_PROBE
589
+
587 590
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
588 591
 //#define Z_PROBE_SLED
589 592
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h View File

@@ -587,6 +587,9 @@
587 587
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
588 588
  */
589 589
 
590
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
591
+//#define SOLENOID_PROBE
592
+
590 593
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
591 594
 //#define Z_PROBE_SLED
592 595
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/K8200/Configuration.h View File

@@ -622,6 +622,9 @@
622 622
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
623 623
  */
624 624
 
625
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
626
+//#define SOLENOID_PROBE
627
+
625 628
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
626 629
 //#define Z_PROBE_SLED
627 630
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/K8400/Configuration.h View File

@@ -593,6 +593,9 @@
593 593
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
594 594
  */
595 595
 
596
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
597
+//#define SOLENOID_PROBE
598
+
596 599
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
597 600
 //#define Z_PROBE_SLED
598 601
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

@@ -593,6 +593,9 @@
593 593
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
594 594
  */
595 595
 
596
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
597
+//#define SOLENOID_PROBE
598
+
596 599
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
597 600
 //#define Z_PROBE_SLED
598 601
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

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

@@ -593,6 +593,9 @@
593 593
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
594 594
  */
595 595
 
596
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
597
+//#define SOLENOID_PROBE
598
+
596 599
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
597 600
 //#define Z_PROBE_SLED
598 601
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -592,6 +592,9 @@
592 592
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
593 593
  */
594 594
 
595
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
596
+//#define SOLENOID_PROBE
597
+
595 598
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
596 599
 //#define Z_PROBE_SLED
597 600
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -608,6 +608,9 @@
608 608
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
609 609
  */
610 610
 
611
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
612
+//#define SOLENOID_PROBE
613
+
611 614
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
612 615
 //#define Z_PROBE_SLED
613 616
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/TAZ4/Configuration.h View File

@@ -613,6 +613,9 @@
613 613
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
614 614
  */
615 615
 
616
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
617
+//#define SOLENOID_PROBE
618
+
616 619
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
617 620
 //#define Z_PROBE_SLED
618 621
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/TinyBoy2/Configuration.h View File

@@ -644,6 +644,9 @@
644 644
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
645 645
  */
646 646
 
647
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
648
+//#define SOLENOID_PROBE
649
+
647 650
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
648 651
 //#define Z_PROBE_SLED
649 652
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -584,6 +584,9 @@
584 584
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
585 585
  */
586 586
 
587
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
588
+//#define SOLENOID_PROBE
589
+
587 590
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
588 591
 //#define Z_PROBE_SLED
589 592
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

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

@@ -593,6 +593,9 @@
593 593
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
594 594
  */
595 595
 
596
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
597
+//#define SOLENOID_PROBE
598
+
596 599
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
597 600
 //#define Z_PROBE_SLED
598 601
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h View File

@@ -662,6 +662,9 @@
662 662
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
663 663
  */
664 664
 
665
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
666
+//#define SOLENOID_PROBE
667
+
665 668
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
666 669
 //#define Z_PROBE_SLED
667 670
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

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

@@ -649,6 +649,9 @@
649 649
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
650 650
  */
651 651
 
652
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
653
+//#define SOLENOID_PROBE
654
+
652 655
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
653 656
 //#define Z_PROBE_SLED
654 657
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

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

@@ -642,6 +642,9 @@
642 642
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
643 643
  */
644 644
 
645
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
646
+//#define SOLENOID_PROBE
647
+
645 648
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
646 649
 //#define Z_PROBE_SLED
647 650
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

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

@@ -643,6 +643,9 @@
643 643
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
644 644
  */
645 645
 
646
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
647
+//#define SOLENOID_PROBE
648
+
646 649
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
647 650
 //#define Z_PROBE_SLED
648 651
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -662,6 +662,9 @@
662 662
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
663 663
  */
664 664
 
665
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
666
+//#define SOLENOID_PROBE
667
+
665 668
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
666 669
 //#define Z_PROBE_SLED
667 670
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/makibox/Configuration.h View File

@@ -596,6 +596,9 @@
596 596
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
597 597
  */
598 598
 
599
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
600
+//#define SOLENOID_PROBE
601
+
599 602
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
600 603
 //#define Z_PROBE_SLED
601 604
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

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

@@ -589,6 +589,9 @@
589 589
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
590 590
  */
591 591
 
592
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
593
+//#define SOLENOID_PROBE
594
+
592 595
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
593 596
 //#define Z_PROBE_SLED
594 597
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

+ 3
- 0
Marlin/example_configurations/wt150/Configuration.h View File

@@ -598,6 +598,9 @@
598 598
  *   is enabled then it also applies to Z_PROBE_SPEED_SLOW.
599 599
  */
600 600
 
601
+// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
602
+//#define SOLENOID_PROBE
603
+
601 604
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
602 605
 //#define Z_PROBE_SLED
603 606
 //#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

Loading…
Cancel
Save