Browse Source

Merge pull request #7504 from thinkyhead/bf1_servo_delays

Individual servo delays
Scott Lahteine 7 years ago
parent
commit
385f1bb9e5
38 changed files with 46 additions and 43 deletions
  1. 1
    0
      .travis.yml
  2. 1
    1
      Marlin/Conditionals_LCD.h
  3. 1
    1
      Marlin/Configuration.h
  4. 7
    7
      Marlin/Marlin_main.cpp
  5. 1
    1
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h
  6. 1
    1
      Marlin/example_configurations/AliExpress/CL-260/Configuration.h
  7. 1
    1
      Marlin/example_configurations/Anet/A6/Configuration.h
  8. 1
    1
      Marlin/example_configurations/Anet/A8/Configuration.h
  9. 1
    1
      Marlin/example_configurations/BQ/Hephestos/Configuration.h
  10. 1
    1
      Marlin/example_configurations/BQ/Hephestos_2/Configuration.h
  11. 1
    1
      Marlin/example_configurations/BQ/WITBOX/Configuration.h
  12. 1
    1
      Marlin/example_configurations/Cartesio/Configuration.h
  13. 1
    1
      Marlin/example_configurations/Creality/CR-10/Configuration.h
  14. 1
    1
      Marlin/example_configurations/Felix/Configuration.h
  15. 1
    1
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  16. 1
    1
      Marlin/example_configurations/Geeetech/GT2560/Configuration.h
  17. 1
    1
      Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h
  18. 1
    1
      Marlin/example_configurations/Infitary/i3-M508/Configuration.h
  19. 1
    1
      Marlin/example_configurations/Malyan/M150/Configuration.h
  20. 1
    1
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  21. 1
    1
      Marlin/example_configurations/RigidBot/Configuration.h
  22. 1
    1
      Marlin/example_configurations/SCARA/Configuration.h
  23. 1
    1
      Marlin/example_configurations/TinyBoy2/Configuration.h
  24. 1
    1
      Marlin/example_configurations/Velleman/K8200/Configuration.h
  25. 1
    1
      Marlin/example_configurations/Velleman/K8400/Configuration.h
  26. 1
    1
      Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h
  27. 1
    1
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  28. 1
    1
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  29. 1
    1
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h
  30. 1
    1
      Marlin/example_configurations/delta/generic/Configuration.h
  31. 1
    1
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  32. 1
    1
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  33. 1
    1
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  34. 1
    1
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h
  35. 1
    1
      Marlin/example_configurations/makibox/Configuration.h
  36. 1
    1
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  37. 1
    1
      Marlin/example_configurations/wt150/Configuration.h
  38. 3
    1
      Marlin/servo.cpp

+ 1
- 0
.travis.yml View File

114
   #
114
   #
115
   - restore_configs
115
   - restore_configs
116
   - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
116
   - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
117
+  - opt_set NUM_SERVOS 1
117
   - opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
118
   - opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
118
   - opt_enable_adv EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET
119
   - opt_enable_adv EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET
119
   - build_marlin
120
   - build_marlin

+ 1
- 1
Marlin/Conditionals_LCD.h View File

377
     #endif
377
     #endif
378
     #undef DEACTIVATE_SERVOS_AFTER_MOVE
378
     #undef DEACTIVATE_SERVOS_AFTER_MOVE
379
     #undef SERVO_DELAY
379
     #undef SERVO_DELAY
380
-    #define SERVO_DELAY 50
380
+    #define SERVO_DELAY { 50 }
381
     #ifndef BLTOUCH_DELAY
381
     #ifndef BLTOUCH_DELAY
382
       #define BLTOUCH_DELAY 375
382
       #define BLTOUCH_DELAY 375
383
     #endif
383
     #endif

+ 1
- 1
Marlin/Configuration.h View File

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

+ 7
- 7
Marlin/Marlin_main.cpp View File

2101
   #if ENABLED(BLTOUCH)
2101
   #if ENABLED(BLTOUCH)
2102
 
2102
 
2103
     void bltouch_command(int angle) {
2103
     void bltouch_command(int angle) {
2104
-      servo[Z_ENDSTOP_SERVO_NR].move(angle);  // Give the BL-Touch the command and wait
2104
+      MOVE_SERVO(Z_ENDSTOP_SERVO_NR, angle);  // Give the BL-Touch the command and wait
2105
       safe_delay(BLTOUCH_DELAY);
2105
       safe_delay(BLTOUCH_DELAY);
2106
     }
2106
     }
2107
 
2107
 
2192
 
2192
 
2193
         #elif HAS_Z_SERVO_ENDSTOP && DISABLED(BLTOUCH)
2193
         #elif HAS_Z_SERVO_ENDSTOP && DISABLED(BLTOUCH)
2194
 
2194
 
2195
-          servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[deploy ? 0 : 1]);
2195
+          MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[deploy ? 0 : 1]);
2196
 
2196
 
2197
         #elif ENABLED(Z_PROBE_ALLEN_KEY)
2197
         #elif ENABLED(Z_PROBE_ALLEN_KEY)
2198
 
2198
 
6702
       SERIAL_ERROR_START();
6702
       SERIAL_ERROR_START();
6703
       SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup");
6703
       SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup");
6704
 
6704
 
6705
-    #else
6705
+    #else // HAS_Z_SERVO_ENDSTOP
6706
 
6706
 
6707
       const uint8_t probe_index = parser.byteval('P', Z_ENDSTOP_SERVO_NR);
6707
       const uint8_t probe_index = parser.byteval('P', Z_ENDSTOP_SERVO_NR);
6708
 
6708
 
6750
       SET_INPUT_PULLUP(PROBE_TEST_PIN);
6750
       SET_INPUT_PULLUP(PROBE_TEST_PIN);
6751
       bool deploy_state, stow_state;
6751
       bool deploy_state, stow_state;
6752
       for (uint8_t i = 0; i < 4; i++) {
6752
       for (uint8_t i = 0; i < 4; i++) {
6753
-        servo[probe_index].move(z_servo_angle[0]); //deploy
6753
+        MOVE_SERVO(probe_index, z_servo_angle[0]); //deploy
6754
         safe_delay(500);
6754
         safe_delay(500);
6755
         deploy_state = READ(PROBE_TEST_PIN);
6755
         deploy_state = READ(PROBE_TEST_PIN);
6756
-        servo[probe_index].move(z_servo_angle[1]); //stow
6756
+        MOVE_SERVO(probe_index, z_servo_angle[1]); //stow
6757
         safe_delay(500);
6757
         safe_delay(500);
6758
         stow_state = READ(PROBE_TEST_PIN);
6758
         stow_state = READ(PROBE_TEST_PIN);
6759
       }
6759
       }
6777
 
6777
 
6778
       }
6778
       }
6779
       else {                                           // measure active signal length
6779
       else {                                           // measure active signal length
6780
-        servo[probe_index].move(z_servo_angle[0]);     // deploy
6780
+        MOVE_SERVO(probe_index, z_servo_angle[0]);     // deploy
6781
         safe_delay(500);
6781
         safe_delay(500);
6782
         SERIAL_PROTOCOLLNPGM("please trigger probe");
6782
         SERIAL_PROTOCOLLNPGM("please trigger probe");
6783
         uint16_t probe_counter = 0;
6783
         uint16_t probe_counter = 0;
6802
             else
6802
             else
6803
               SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse
6803
               SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse
6804
 
6804
 
6805
-            servo[probe_index].move(z_servo_angle[1]); //stow
6805
+            MOVE_SERVO(probe_index, z_servo_angle[1]); //stow
6806
 
6806
 
6807
           }  // pulse detected
6807
           }  // pulse detected
6808
 
6808
 

+ 1
- 1
Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h View File

1616
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1616
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1617
 // 300ms is a good value but you can try less delay.
1617
 // 300ms is a good value but you can try less delay.
1618
 // If the servo can't reach the requested position, increase it.
1618
 // If the servo can't reach the requested position, increase it.
1619
-#define SERVO_DELAY 300
1619
+#define SERVO_DELAY { 300 }
1620
 
1620
 
1621
 // Servo deactivation
1621
 // Servo deactivation
1622
 //
1622
 //

+ 1
- 1
Marlin/example_configurations/AliExpress/CL-260/Configuration.h View File

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

+ 1
- 1
Marlin/example_configurations/Anet/A6/Configuration.h View File

1755
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1755
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1756
 // 300ms is a good value but you can try less delay.
1756
 // 300ms is a good value but you can try less delay.
1757
 // If the servo can't reach the requested position, increase it.
1757
 // If the servo can't reach the requested position, increase it.
1758
-#define SERVO_DELAY 300
1758
+#define SERVO_DELAY { 300 }
1759
 
1759
 
1760
 // Servo deactivation
1760
 // Servo deactivation
1761
 //
1761
 //

+ 1
- 1
Marlin/example_configurations/Anet/A8/Configuration.h View File

1604
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1604
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1605
 // 300ms is a good value but you can try less delay.
1605
 // 300ms is a good value but you can try less delay.
1606
 // If the servo can't reach the requested position, increase it.
1606
 // If the servo can't reach the requested position, increase it.
1607
-#define SERVO_DELAY 300
1607
+#define SERVO_DELAY { 300 }
1608
 
1608
 
1609
 // Servo deactivation
1609
 // Servo deactivation
1610
 //
1610
 //

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

1587
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1587
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1588
 // 300ms is a good value but you can try less delay.
1588
 // 300ms is a good value but you can try less delay.
1589
 // If the servo can't reach the requested position, increase it.
1589
 // If the servo can't reach the requested position, increase it.
1590
-#define SERVO_DELAY 300
1590
+#define SERVO_DELAY { 300 }
1591
 
1591
 
1592
 // Servo deactivation
1592
 // Servo deactivation
1593
 //
1593
 //

+ 1
- 1
Marlin/example_configurations/BQ/Hephestos_2/Configuration.h View File

1597
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1598
 // 300ms is a good value but you can try less delay.
1598
 // 300ms is a good value but you can try less delay.
1599
 // If the servo can't reach the requested position, increase it.
1599
 // If the servo can't reach the requested position, increase it.
1600
-#define SERVO_DELAY 300
1600
+#define SERVO_DELAY { 300 }
1601
 
1601
 
1602
 // Servo deactivation
1602
 // Servo deactivation
1603
 //
1603
 //

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

1587
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1587
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1588
 // 300ms is a good value but you can try less delay.
1588
 // 300ms is a good value but you can try less delay.
1589
 // If the servo can't reach the requested position, increase it.
1589
 // If the servo can't reach the requested position, increase it.
1590
-#define SERVO_DELAY 300
1590
+#define SERVO_DELAY { 300 }
1591
 
1591
 
1592
 // Servo deactivation
1592
 // Servo deactivation
1593
 //
1593
 //

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

1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // 300ms is a good value but you can try less delay.
1596
 // 300ms is a good value but you can try less delay.
1597
 // If the servo can't reach the requested position, increase it.
1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599
 
1599
 
1600
 // Servo deactivation
1600
 // Servo deactivation
1601
 //
1601
 //

+ 1
- 1
Marlin/example_configurations/Creality/CR-10/Configuration.h View File

1608
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1608
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1609
 // 300ms is a good value but you can try less delay.
1609
 // 300ms is a good value but you can try less delay.
1610
 // If the servo can't reach the requested position, increase it.
1610
 // If the servo can't reach the requested position, increase it.
1611
-#define SERVO_DELAY 300
1611
+#define SERVO_DELAY { 300 }
1612
 
1612
 
1613
 // Servo deactivation
1613
 // Servo deactivation
1614
 //
1614
 //

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

1578
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1578
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1579
 // 300ms is a good value but you can try less delay.
1579
 // 300ms is a good value but you can try less delay.
1580
 // If the servo can't reach the requested position, increase it.
1580
 // If the servo can't reach the requested position, increase it.
1581
-#define SERVO_DELAY 300
1581
+#define SERVO_DELAY { 300 }
1582
 
1582
 
1583
 // Servo deactivation
1583
 // Servo deactivation
1584
 //
1584
 //

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

1578
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1578
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1579
 // 300ms is a good value but you can try less delay.
1579
 // 300ms is a good value but you can try less delay.
1580
 // If the servo can't reach the requested position, increase it.
1580
 // If the servo can't reach the requested position, increase it.
1581
-#define SERVO_DELAY 300
1581
+#define SERVO_DELAY { 300 }
1582
 
1582
 
1583
 // Servo deactivation
1583
 // Servo deactivation
1584
 //
1584
 //

+ 1
- 1
Marlin/example_configurations/Geeetech/GT2560/Configuration.h View File

1611
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1611
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1612
 // 300ms is a good value but you can try less delay.
1612
 // 300ms is a good value but you can try less delay.
1613
 // If the servo can't reach the requested position, increase it.
1613
 // If the servo can't reach the requested position, increase it.
1614
-#define SERVO_DELAY 300
1614
+#define SERVO_DELAY { 300 }
1615
 
1615
 
1616
 // Servo deactivation
1616
 // Servo deactivation
1617
 //
1617
 //

+ 1
- 1
Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h View File

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

+ 1
- 1
Marlin/example_configurations/Infitary/i3-M508/Configuration.h View File

1600
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1600
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1601
 // 300ms is a good value but you can try less delay.
1601
 // 300ms is a good value but you can try less delay.
1602
 // If the servo can't reach the requested position, increase it.
1602
 // If the servo can't reach the requested position, increase it.
1603
-#define SERVO_DELAY 300
1603
+#define SERVO_DELAY { 300 }
1604
 
1604
 
1605
 // Servo deactivation
1605
 // Servo deactivation
1606
 //
1606
 //

+ 1
- 1
Marlin/example_configurations/Malyan/M150/Configuration.h View File

1624
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1624
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1625
 // 300ms is a good value but you can try less delay.
1625
 // 300ms is a good value but you can try less delay.
1626
 // If the servo can't reach the requested position, increase it.
1626
 // If the servo can't reach the requested position, increase it.
1627
-#define SERVO_DELAY 300
1627
+#define SERVO_DELAY { 300 }
1628
 
1628
 
1629
 // Servo deactivation
1629
 // Servo deactivation
1630
 //
1630
 //

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

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

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

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

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

1608
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1608
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1609
 // 300ms is a good value but you can try less delay.
1609
 // 300ms is a good value but you can try less delay.
1610
 // If the servo can't reach the requested position, increase it.
1610
 // If the servo can't reach the requested position, increase it.
1611
-#define SERVO_DELAY 300
1611
+#define SERVO_DELAY { 300 }
1612
 
1612
 
1613
 // Servo deactivation
1613
 // Servo deactivation
1614
 //
1614
 //

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

1652
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1652
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1653
 // 300ms is a good value but you can try less delay.
1653
 // 300ms is a good value but you can try less delay.
1654
 // If the servo can't reach the requested position, increase it.
1654
 // If the servo can't reach the requested position, increase it.
1655
-#define SERVO_DELAY 300
1655
+#define SERVO_DELAY { 300 }
1656
 
1656
 
1657
 // Servo deactivation
1657
 // Servo deactivation
1658
 //
1658
 //

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

1630
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1630
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1631
 // 300ms is a good value but you can try less delay.
1631
 // 300ms is a good value but you can try less delay.
1632
 // If the servo can't reach the requested position, increase it.
1632
 // If the servo can't reach the requested position, increase it.
1633
-#define SERVO_DELAY 300
1633
+#define SERVO_DELAY { 300 }
1634
 
1634
 
1635
 // Servo deactivation
1635
 // Servo deactivation
1636
 //
1636
 //

+ 1
- 1
Marlin/example_configurations/Velleman/K8400/Configuration.h View File

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

+ 1
- 1
Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h View File

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

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

1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597
 // 300ms is a good value but you can try less delay.
1597
 // 300ms is a good value but you can try less delay.
1598
 // If the servo can't reach the requested position, increase it.
1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600
 
1600
 
1601
 // Servo deactivation
1601
 // Servo deactivation
1602
 //
1602
 //

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

1724
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1724
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1725
 // 300ms is a good value but you can try less delay.
1725
 // 300ms is a good value but you can try less delay.
1726
 // If the servo can't reach the requested position, increase it.
1726
 // If the servo can't reach the requested position, increase it.
1727
-#define SERVO_DELAY 300
1727
+#define SERVO_DELAY { 300 }
1728
 
1728
 
1729
 // Servo deactivation
1729
 // Servo deactivation
1730
 //
1730
 //

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

1717
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1717
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1718
 // 300ms is a good value but you can try less delay.
1718
 // 300ms is a good value but you can try less delay.
1719
 // If the servo can't reach the requested position, increase it.
1719
 // If the servo can't reach the requested position, increase it.
1720
-#define SERVO_DELAY 300
1720
+#define SERVO_DELAY { 300 }
1721
 
1721
 
1722
 // Servo deactivation
1722
 // Servo deactivation
1723
 //
1723
 //

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

1712
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1712
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1713
 // 300ms is a good value but you can try less delay.
1713
 // 300ms is a good value but you can try less delay.
1714
 // If the servo can't reach the requested position, increase it.
1714
 // If the servo can't reach the requested position, increase it.
1715
-#define SERVO_DELAY 300
1715
+#define SERVO_DELAY { 300 }
1716
 
1716
 
1717
 // Servo deactivation
1717
 // Servo deactivation
1718
 //
1718
 //

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

1715
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1715
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1716
 // 300ms is a good value but you can try less delay.
1716
 // 300ms is a good value but you can try less delay.
1717
 // If the servo can't reach the requested position, increase it.
1717
 // If the servo can't reach the requested position, increase it.
1718
-#define SERVO_DELAY 300
1718
+#define SERVO_DELAY { 300 }
1719
 
1719
 
1720
 // Servo deactivation
1720
 // Servo deactivation
1721
 //
1721
 //

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

1715
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1715
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1716
 // 300ms is a good value but you can try less delay.
1716
 // 300ms is a good value but you can try less delay.
1717
 // If the servo can't reach the requested position, increase it.
1717
 // If the servo can't reach the requested position, increase it.
1718
-#define SERVO_DELAY 300
1718
+#define SERVO_DELAY { 300 }
1719
 
1719
 
1720
 // Servo deactivation
1720
 // Servo deactivation
1721
 //
1721
 //

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

1724
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1724
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1725
 // 300ms is a good value but you can try less delay.
1725
 // 300ms is a good value but you can try less delay.
1726
 // If the servo can't reach the requested position, increase it.
1726
 // If the servo can't reach the requested position, increase it.
1727
-#define SERVO_DELAY 300
1727
+#define SERVO_DELAY { 300 }
1728
 
1728
 
1729
 // Servo deactivation
1729
 // Servo deactivation
1730
 //
1730
 //

+ 1
- 1
Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h View File

1610
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1610
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1611
 // 300ms is a good value but you can try less delay.
1611
 // 300ms is a good value but you can try less delay.
1612
 // If the servo can't reach the requested position, increase it.
1612
 // If the servo can't reach the requested position, increase it.
1613
-#define SERVO_DELAY 300
1613
+#define SERVO_DELAY { 300 }
1614
 
1614
 
1615
 // Servo deactivation
1615
 // Servo deactivation
1616
 //
1616
 //

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

1599
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1599
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1600
 // 300ms is a good value but you can try less delay.
1600
 // 300ms is a good value but you can try less delay.
1601
 // If the servo can't reach the requested position, increase it.
1601
 // If the servo can't reach the requested position, increase it.
1602
-#define SERVO_DELAY 300
1602
+#define SERVO_DELAY { 300 }
1603
 
1603
 
1604
 // Servo deactivation
1604
 // Servo deactivation
1605
 //
1605
 //

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

1591
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1591
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1592
 // 300ms is a good value but you can try less delay.
1592
 // 300ms is a good value but you can try less delay.
1593
 // If the servo can't reach the requested position, increase it.
1593
 // If the servo can't reach the requested position, increase it.
1594
-#define SERVO_DELAY 300
1594
+#define SERVO_DELAY { 300 }
1595
 
1595
 
1596
 // Servo deactivation
1596
 // Servo deactivation
1597
 //
1597
 //

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

1601
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1601
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1602
 // 300ms is a good value but you can try less delay.
1602
 // 300ms is a good value but you can try less delay.
1603
 // If the servo can't reach the requested position, increase it.
1603
 // If the servo can't reach the requested position, increase it.
1604
-#define SERVO_DELAY 300
1604
+#define SERVO_DELAY { 300 }
1605
 
1605
 
1606
 // Servo deactivation
1606
 // Servo deactivation
1607
 //
1607
 //

+ 3
- 1
Marlin/servo.cpp View File

308
 bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
308
 bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
309
 
309
 
310
 void Servo::move(int value) {
310
 void Servo::move(int value) {
311
+  constexpr uint16_t servo_delay[] = SERVO_DELAY;
312
+  static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
311
   if (this->attach(0) >= 0) {
313
   if (this->attach(0) >= 0) {
312
     this->write(value);
314
     this->write(value);
313
-    delay(SERVO_DELAY);
315
+    delay(servo_delay[this->servoIndex]);
314
     #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
316
     #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
315
       this->detach();
317
       this->detach();
316
     #endif
318
     #endif

Loading…
Cancel
Save