Skip to content

Commit

Permalink
Z_SERVO_DEACTIVATE_AFTER_STOW
Browse files Browse the repository at this point in the history
  • Loading branch information
FilippoR committed Mar 9, 2023
1 parent 32dcd7f commit 9f220d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,7 @@
//#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles
//#define Z_SERVO_MEASURE_ANGLE 45 // Use if the servo must move to a "free" position for measuring after deploy.
//#define Z_SERVO_INTERMEDIATE_STOW // Stow the probe between points.
//#define Z_SERVO_DEACTIVATE_AFTER_STOW // Deactivate Z_SERVO when probe is stowed

/**
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
Expand Down
10 changes: 8 additions & 2 deletions Marlin/src/module/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,14 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
#elif HAS_Z_SERVO_PROBE

servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]);

#ifdef Z_SERVO_MEASURE_ANGLE
// After deploy move back to the measure angle...
if (deploy) MOVE_SERVO(Z_PROBE_SERVO_NR, Z_SERVO_MEASURE_ANGLE);
#endif
#ifdef Z_SERVO_DEACTIVATE_AFTER_STOW
if(!deploy)
servo[Z_PROBE_SERVO_NR].detach();
#endif

#elif ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)

Expand Down Expand Up @@ -940,7 +943,10 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
* There's no way to know where the nozzle is positioned until
* homing has been done - no homing with z-probe without init!
*/
STOW_Z_SERVO();
servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][1]);
#ifdef Z_SERVO_DEACTIVATE_AFTER_STOW
servo[Z_PROBE_SERVO_NR].detach();
#endif
}

#endif // HAS_Z_SERVO_PROBE
Expand Down

0 comments on commit 9f220d7

Please sign in to comment.