Skip to content

Commit

Permalink
Merge pull request MarlinFirmware#4122 from thinkyhead/rc_xy_travel_f…
Browse files Browse the repository at this point in the history
…eedrate

Make XY Probe (travel) Speed available in G28
  • Loading branch information
thinkyhead authored Jun 22, 2016
2 parents 937123a + bd99a2b commit f30df89
Show file tree
Hide file tree
Showing 24 changed files with 110 additions and 99 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ script:
- opt_enable PIDTEMPBED
- build_marlin
#
# Test a "Fix Mounted" Probe
# Test a "Fix Mounted" Probe along with Safe Homing
#
- restore_configs
- opt_enable FIX_MOUNTED_PROBE
- opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING
- build_marlin
#
# ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE
Expand Down
17 changes: 6 additions & 11 deletions Marlin/Conditionals.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,6 @@
#define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
#define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
#define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))

#ifndef XY_TRAVEL_SPEED
#ifdef HOMING_FEEDRATE_XYZ
#define XY_TRAVEL_SPEED HOMING_FEEDRATE_XYZ
#else
#define XY_TRAVEL_SPEED 4000
#endif
#endif

#endif

#define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
Expand Down Expand Up @@ -784,8 +775,12 @@
#ifndef Z_PROBE_OFFSET_RANGE_MAX
#define Z_PROBE_OFFSET_RANGE_MAX 20
#endif
#ifndef XY_TRAVEL_SPEED
#define XY_TRAVEL_SPEED 4000
#ifndef XY_PROBE_SPEED
#ifdef HOMING_FEEDRATE_XYZ
#define XY_PROBE_SPEED HOMING_FEEDRATE_XYZ
#else
#define XY_PROBE_SPEED 4000
#endif
#endif
#endif

Expand Down
5 changes: 3 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -667,8 +670,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
32 changes: 13 additions & 19 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,13 @@ static uint8_t target_extruder;
#endif

#if ENABLED(AUTO_BED_LEVELING_FEATURE)
int xy_travel_speed = XY_TRAVEL_SPEED;
int xy_probe_speed = XY_PROBE_SPEED;
bool bed_leveling_in_progress = false;
#define XY_PROBE_FEEDRATE xy_probe_speed
#elif defined(XY_PROBE_SPEED)
#define XY_PROBE_FEEDRATE XY_PROBE_SPEED
#else
#define XY_PROBE_FEEDRATE (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60)
#endif

#if ENABLED(Z_DUAL_ENDSTOPS) && DISABLED(DELTA)
Expand Down Expand Up @@ -1633,13 +1638,7 @@ static void setup_for_endstop_move() {

#if ENABLED(DELTA)

feedrate =
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
xy_travel_speed
#else
min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60
#endif
;
feedrate = XY_PROBE_FEEDRATE;

destination[X_AXIS] = x;
destination[Y_AXIS] = y;
Expand All @@ -1658,13 +1657,7 @@ static void setup_for_endstop_move() {
line_to_current_position();
stepper.synchronize();

feedrate =
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
xy_travel_speed
#else
min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60
#endif
;
feedrate = XY_PROBE_FEEDRATE;

current_position[X_AXIS] = x;
current_position[Y_AXIS] = y;
Expand Down Expand Up @@ -2981,7 +2974,8 @@ inline void gcode_G28() {
destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER));
destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER));
destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height
feedrate = XY_TRAVEL_SPEED;

feedrate = XY_PROBE_FEEDRATE;

#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
Expand Down Expand Up @@ -3403,7 +3397,7 @@ inline void gcode_G28() {
}
#endif

xy_travel_speed = code_seen('S') ? (int)code_value_linear_units() : XY_TRAVEL_SPEED;
xy_probe_speed = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED;

int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LEFT_PROBE_BED_POSITION,
right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : RIGHT_PROBE_BED_POSITION,
Expand Down Expand Up @@ -6564,8 +6558,8 @@ inline void gcode_T(uint8_t tmp_extruder) {
}
else {
feedrate =
#ifdef XY_TRAVEL_SPEED
XY_TRAVEL_SPEED
#ifdef XY_PROBE_SPEED
XY_PROBE_SPEED
#else
min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60
#endif
Expand Down
2 changes: 2 additions & 0 deletions Marlin/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@
#error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
#error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
#elif defined(XY_TRAVEL_SPEED)
#error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
#endif

#endif //SANITYCHECK_H
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Cartesio/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -666,8 +669,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -649,8 +652,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Felix/DUAL/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -647,8 +650,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Hephestos/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -659,8 +662,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Hephestos_2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -661,8 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 2 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/K8200/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -684,8 +687,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -667,8 +670,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/RigidBot/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -661,8 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/SCARA/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -675,8 +678,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/TAZ4/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -688,8 +691,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/WITBOX/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -659,8 +662,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/adafruit/ST7565/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

//
// Allen Key Probe is defined in the Delta example configurations.
//
Expand Down Expand Up @@ -667,8 +670,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

#endif // !AUTO_BED_LEVELING_GRID

#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.

#define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
Expand Down
Loading

0 comments on commit f30df89

Please sign in to comment.