Browse Source

✨ Configurable Switching Nozzle dwell (#24304)

InsanityAutomation 1 year ago
parent
commit
91f9e1671f
No account linked to committer's email address
2 changed files with 3 additions and 2 deletions
  1. 1
    0
      Marlin/Configuration.h
  2. 2
    2
      Marlin/src/module/tool_change.cpp

+ 1
- 0
Marlin/Configuration.h View File

270
   #define SWITCHING_NOZZLE_SERVO_NR 0
270
   #define SWITCHING_NOZZLE_SERVO_NR 0
271
   //#define SWITCHING_NOZZLE_E1_SERVO_NR 1          // If two servos are used, the index of the second
271
   //#define SWITCHING_NOZZLE_E1_SERVO_NR 1          // If two servos are used, the index of the second
272
   #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 }   // Angles for E0, E1 (single servo) or lowered/raised (dual servo)
272
   #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 }   // Angles for E0, E1 (single servo) or lowered/raised (dual servo)
273
+  #define SWITCHING_NOZZLE_SERVO_DWELL 2500         // Dwell time to wait for servo to make physical move
273
 #endif
274
 #endif
274
 
275
 
275
 /**
276
 /**

+ 2
- 2
Marlin/src/module/tool_change.cpp View File

132
       constexpr int16_t sns_angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES;
132
       constexpr int16_t sns_angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES;
133
       planner.synchronize();
133
       planner.synchronize();
134
       servo[sns_index[e]].move(sns_angles[angle_index]);
134
       servo[sns_index[e]].move(sns_angles[angle_index]);
135
-      safe_delay(500);
135
+      safe_delay(SWITCHING_NOZZLE_SERVO_DWELL);
136
     }
136
     }
137
 
137
 
138
     void lower_nozzle(const uint8_t e) { _move_nozzle_servo(e, 0); }
138
     void lower_nozzle(const uint8_t e) { _move_nozzle_servo(e, 0); }
143
     void move_nozzle_servo(const uint8_t angle_index) {
143
     void move_nozzle_servo(const uint8_t angle_index) {
144
       planner.synchronize();
144
       planner.synchronize();
145
       servo[SWITCHING_NOZZLE_SERVO_NR].move(servo_angles[SWITCHING_NOZZLE_SERVO_NR][angle_index]);
145
       servo[SWITCHING_NOZZLE_SERVO_NR].move(servo_angles[SWITCHING_NOZZLE_SERVO_NR][angle_index]);
146
-      safe_delay(500);
146
+      safe_delay(SWITCHING_NOZZLE_SERVO_DWELL);
147
     }
147
     }
148
 
148
 
149
   #endif
149
   #endif

Loading…
Cancel
Save