Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify dock_sled() and some more probe tweaks #4160

Closed
wants to merge 3 commits into from

Conversation

AnHardt
Copy link
Member

@AnHardt AnHardt commented Jun 27, 2016

Simplify dock_sled()
dock_sled() is never called with offset parameter - remove it.
We move x only - so only that needs to be homed. Consequence is - we can home to z-min now with a sled probe!
Feedrates are set and restored in do_blocking_move().
We already checked if the probe is deployed/stowed in deploy/stow_probe.

if (z_loc < _Z_RAISE_PROBE_DEPLOY_STOW + 5) z_loc = _Z_RAISE_PROBE_DEPLOY_STOW;
makes no sense - remove.
Now the raise is the same for deploy/stow -> move before the if - and remove at all because already done in deploy/stow_probe.
Replace the if with a ternary.
Instead writing LOW/HIGH use the boolean stow we already have.

There is no reason for not using the sled probe in G29/M48 with 'E'.
It takes a while but works. (tested!)

universalize axis_unhomed_error()

Some more tweaks
Feedrates are set in do_blocking_move()
_Z_RAISE_PROBE_DEPLOY_STOW is always defined here.
If HAS_BED_PROBE is defined in G28 we have a shothand.
Debug output for home y for the HOME_Y_BEFORE_X case.

@thinkyhead
Copy link
Member

Feedrates are set and restored in do_blocking_move().

Huh, I thought I had done that one.

@@ -1713,27 +1713,37 @@ static void clean_up_after_endstop_or_probe_move() {
z_dest -= zprobe_zoffset;

if (z_dest > current_position[Z_AXIS]) {
float old_feedrate = feedrate;
feedrate = homing_feedrate[Z_AXIS];
Copy link
Member

@thinkyhead thinkyhead Jun 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't set the feedrate for Z here, it doesn't get set anywhere else.

I also noticed, in gcode_M48 it's not setting feedrate for the move at the end of the n_legs loop. I believe it should set the feedrate to XY_PROBE_SPEED ahead of the loop.

Of course, do_blocking_move could handle all of this, applying the Z feedrate for Z-only moves, and the XY_PROBE_SPEED for others, and then functions that call it can leave off setting feedrate themselves.

Copy link
Contributor

@Blue-Marlin Blue-Marlin Jun 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excep of line 1662, 1674, 1667 in do_blocking_move_to(). Please look it up. (https://github.com/MarlinFirmware/Marlin/blob/RCBugFix/Marlin/Marlin_main.cpp#L1638)
As long as we do only blocking moves the feedrates are set and restored.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah! I've been forgetting song lyrics lately too. Need more vitamins!

@thinkyhead
Copy link
Member

Getting better all the time… Check my comments for some suggestions, and of course please keep adding more commits if you see anything else needing a tweak!

`dock_sled()` is never called with offset parameter - remove it.
We move x only - so only that needs to be homed. Consequence is - we can home to z-min now with a sled probe!
Feedrates are set and restored in `do_blocking_move()`.
We already checked if the probe is deployed/stowed in deploy/stow_probe.
```
if (z_loc < _Z_RAISE_PROBE_DEPLOY_STOW + 5) z_loc = _Z_RAISE_PROBE_DEPLOY_STOW;
```
makes no sense - remove.
Now the raise is the same for deploy/stow -> move before the if.
Replace the if with a ternary.
Instead writing LOW/HIGH use the boolean `stow` we already have.

There is no reason for not using the sled probe in G29/M48 with 'E'.
It takes a while but works. (tested!)
@thinkyhead thinkyhead closed this Jun 28, 2016
@AnHardt AnHardt deleted the sled3 branch June 28, 2016 15:04
@jbrazio jbrazio modified the milestone: 1.1.0 Jul 18, 2016
drewmoseley pushed a commit to drewmoseley/Marlin that referenced this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants