1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Merge branch 'ProbeDeployment' into Development

This commit is contained in:
Richard Wackerbarth 2015-06-06 17:49:20 -05:00
commit 0c7bdf569c
2 changed files with 121 additions and 44 deletions

View File

@ -1296,27 +1296,9 @@ static void setup_for_endstop_move() {
}
#elif defined(Z_PROBE_ALLEN_KEY)
feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
feedrate = homing_feedrate[X_AXIS];
// Move to the start position to initiate deployment
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X;
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y;
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z;
prepare_move_raw(); // this will also set_current_to_destination
// Home X to touch the belt
feedrate = homing_feedrate[X_AXIS]/10;
destination[X_AXIS] = 0;
prepare_move_raw(); // this will also set_current_to_destination
// Home Y for safety
feedrate = homing_feedrate[X_AXIS]/2;
destination[Y_AXIS] = 0;
prepare_move_raw(); // this will also set_current_to_destination
st_synchronize();
// If endstop is already false, the probe is deployed
#ifdef Z_PROBE_ENDSTOP
bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
if (z_probe_endstop)
@ -1325,6 +1307,65 @@ static void setup_for_endstop_move() {
if (z_min_endstop)
#endif
{
// Move to the start position to initiate deployment
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z;
prepare_move_raw(); // this will also set_current_to_destination
// Move to engage deployment
if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE) {
feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE;
}
if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X) {
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X;
}
if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) {
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y;
}
if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) {
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z;
}
prepare_move_raw();
#ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) {
feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
}
// Move to trigger deployment
if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) {
feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
}
if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X) {
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X;
}
if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) {
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y;
}
if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) {
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z;
}
prepare_move_raw();
#endif
}
// Partially Home X,Y for safety
destination[X_AXIS] = destination[X_AXIS]*0.75;
destination[Y_AXIS] = destination[Y_AXIS]*0.75;
prepare_move_raw(); // this will also set_current_to_destination
st_synchronize();
#ifdef Z_PROBE_ENDSTOP
z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
if (z_probe_endstop)
#else
z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
if (z_min_endstop)
#endif
{
if (IsRunning()) {
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
@ -1366,25 +1407,41 @@ static void setup_for_endstop_move() {
#elif defined(Z_PROBE_ALLEN_KEY)
// Move up for safety
feedrate = homing_feedrate[X_AXIS];
feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
prepare_move_raw(); // this will also set_current_to_destination
// Move to the start position to initiate retraction
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_X;
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Y;
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Z;
prepare_move_raw(); // this will also set_current_to_destination
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y;
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z;
prepare_move_raw();
// Move the nozzle down to push the probe into retracted position
feedrate = homing_feedrate[Z_AXIS]/10;
destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_STOW_DEPTH;
prepare_move_raw(); // this will also set_current_to_destination
if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE) {
feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
}
if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X) {
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
}
if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y) {
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
}
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;
prepare_move_raw();
// Move up for safety
feedrate = homing_feedrate[Z_AXIS]/2;
destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_STOW_DEPTH * 2;
prepare_move_raw(); // this will also set_current_to_destination
if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE) {
feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
}
if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X) {
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X;
}
if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y) {
destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y;
}
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z;
prepare_move_raw();
// Home XY for safety
feedrate = homing_feedrate[X_AXIS]/2;

View File

@ -507,14 +507,34 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
#define Z_PROBE_ALLEN_KEY
#ifdef Z_PROBE_ALLEN_KEY
#define Z_PROBE_ALLEN_KEY_DEPLOY_X 30
#define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
#define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100
#define Z_PROBE_ALLEN_KEY_STOW_X -64
#define Z_PROBE_ALLEN_KEY_STOW_Y 56
#define Z_PROBE_ALLEN_KEY_STOW_Z 23
// Kossel Mini
#define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED/10)
#define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
// Move the probe into position
#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0
#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
#define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED
// Move the nozzle down further to push the probe into retracted position.
#define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X
#define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y
#define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH)
#define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED/10)
// Raise things back up slightly so we don't bump into anything
#define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X
#define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y
#define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH)
#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_TRAVEL_SPEED/2)
#endif
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk