FIX: Extra lift after time-lapse when traveling to prime tower

jira: STUDIO-11990
Change-Id: I96e61b9cdde2c983698e9297ec10c3ce4bf7478a
This commit is contained in:
zhimin.zeng 2025-05-06 20:31:51 +08:00 committed by lane.wei
parent 8c8b8d63b9
commit 8c63d002e8

View File

@ -438,20 +438,24 @@ std::string GCodeWriter::eager_lift(const LiftType type, bool tool_change)
}
}
double to_lift = target_lift - m_lifted;
if (to_lift < EPSILON)
return lift_move;
// BBS: spiral lift only safe with known position
// TODO: check the arc will move within bed area
if (type == LiftType::SpiralLift && this->is_current_position_clear()) {
double radius = target_lift / (2 * PI * atan(GCodeWriter::slope_threshold));
if (to_lift > 0) {
double radius = to_lift / (2 * PI * atan(GCodeWriter::slope_threshold));
// static spiral alignment when no move in x,y plane.
// spiral centra is a radius distance to the right (y=0)
Vec2d ij_offset = { radius, 0 };
if (target_lift > 0) {
lift_move = this->_spiral_travel_to_z(m_pos(2) + target_lift, ij_offset, "spiral lift Z",tool_change);
lift_move = this->_spiral_travel_to_z(m_pos(2) + to_lift, ij_offset, "spiral lift Z",tool_change);
}
}
//BBS: if position is unknown use normal lift
else if (target_lift > 0) {
lift_move = _travel_to_z(m_pos(2) + target_lift, "normal lift Z",tool_change);
else if (to_lift > 0) {
lift_move = _travel_to_z(m_pos(2) + to_lift, "normal lift Z", tool_change);
}
m_lifted = target_lift;
m_to_lift = 0;