MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.27k stars 19.23k forks source link

Z safe homing #4784

Closed adamfilip closed 8 years ago

adamfilip commented 8 years ago

using RC7 Bugfix I have enabled Z home homing, but its not moving the gantry to the middle of the bed.

my printer homes to Y max instead of Y Min, not sure if this is causing an issue

my travel limits are

#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS 310
#define Y_MAX_POS 300
#define Z_MAX_POS 300

// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1]
#define X_HOME_DIR -1
#define Y_HOME_DIR 1
#define Z_HOME_DIR -1
thinkyhead commented 8 years ago

Ah yes.... There's a bug in Z_SAFE_HOMING. If your probe is outside the bed when you try to use it, it will not perform the move. The problem is this test:

float cpx = RAW_CURRENT_POSITION(X_AXIS), cpy = RAW_CURRENT_POSITION(Y_AXIS);
if (   cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
    && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
    && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
    && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) { . . .

To fix the issue, change the first line to:

float cpx = RAW_X_POSITION(destination[X_AXIS]), cpy = RAW_Y_POSITION(destination[Y_AXIS]);

I have a patch pending for RCBugFix that will be merged today.

adamfilip commented 8 years ago

Thanks :)

boelle commented 8 years ago

@adamfilip was the issue fixed?

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.