This came from mwyrick. I haven't had time to check it out, but I think what he says (and did) is correct.

Y-Axis moving during Z Raise for Unsafe Home

Roxy,
I noticed you helping several people with the problem of the Y-Axis moving with the initial Z Raise during homing when Safe homing is not enabled. I have a fix for that that I have not seen in the code yet. I wanted to share it with you. It also fixes G28 finishing too high when doing a raising before retracting.

In Marlin_main.cpp in the homeaxis function, after

axis_is_at_home(axis);
destination[axis] = current_position[axis];
feedrate = 0.0;
endstops_hit_on_purpose();
axis_known_position[axis] = true;
I added:

plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);


The problem was after current_position was set to zero, the planner position was not set and the delta for the move was too large by the amount of the commanded move final to find the switch, -2*home_retract_mm. With this change I can now issue just a G28 and have to current_position correct so I don't need to run G29 if I don't want to. Or run with Z_SAFE_HOME disabled.

- Michael