Skip to content

Commit

Permalink
Fix 3-point middle point (#18383)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoellerDi authored Jun 22, 2020
1 parent e52afa8 commit 3bfbd47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class Probe {
#else
points[0].set(min_x(), min_y());
points[1].set(max_x(), min_y());
points[2].set((max_x() - min_x()) / 2, max_y());
points[2].set((min_x() + max_x()) / 2, max_y());
#endif
#endif
}
Expand Down

3 comments on commit 3bfbd47

@anlupat
Copy link

Choose a reason for hiding this comment

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

@MoellerDi i got a question about the 3th point, my understanding of the code is that the probe offset is not used in this calculation. Am I correct? Shouldn't it be used in this calculation?

@MoellerDi
Copy link
Contributor Author

@MoellerDi MoellerDi commented on 3bfbd47 Jun 24, 2020

Choose a reason for hiding this comment

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

@anlupat The probe offset is considered in min_x(), max_y() as well as min_y(), max_y(). See line 138-173 in probe.h

You will see PROBING_MARGIN and offset_xy is being used in that calculation. For more details on how the code is doing the calculation, please see my comment in the related issue (#17203 (comment))

    static inline float min_x() {
      return (
        #if IS_KINEMATIC
          (X_CENTER) - probe_radius()
        #else
          _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x)
        #endif
      );
    }
    static inline float max_x() {
      return (
        #if IS_KINEMATIC
          (X_CENTER) + probe_radius()
        #else
          _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x)
        #endif
      );
    }
    static inline float min_y() {
      return (
        #if IS_KINEMATIC
          (Y_CENTER) - probe_radius()
        #else
          _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y)
        #endif
      );
    }
    static inline float max_y() {
      return (
        #if IS_KINEMATIC
          (Y_CENTER) + probe_radius()
        #else
          _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y)
        #endif
      );
    }

@anlupat
Copy link

@anlupat anlupat commented on 3bfbd47 Jun 24, 2020 via email

Choose a reason for hiding this comment

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

Please sign in to comment.