Skip to content

Commit cfa9657

Browse files
committed
Fixed potential issue with axes released before TravelToStartPoint
Function TravelToStartPoint was called aftrer calling LockCurrentMovementSystemAndWaitForStandstill which releases all axes not associated with the current tool. A tool change may also have taken place, which will ave released axes ont owned by the new tool. So TravelToStartPoint needs to allocate appropriate axes.
1 parent 604625a commit cfa9657

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/GCodes/GCodes.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3122,8 +3122,9 @@ void GCodes::FinaliseMove(GCodeBuffer& gb, MovementState& ms) noexcept
31223122
}
31233123

31243124
// Set up a move to travel to the resume point. Return true if successful, false if needs to be called again.
3125+
// This is only called if the first move commanded since changing from a cancelled object to a non-cancelled object or to no object involves extrusion.
31253126
// By the time this is called, the user position has been overwritten with the final position of the pending move, so we can't use it.
3126-
// But the expected position was saved by buildObjects when the state changed from printing a cancelled object to printing a live object.
3127+
// But the expected position was saved in the resume object restore point when the state changed from printing a cancelled object to printing a live object.
31273128
void GCodes::TravelToStartPoint(GCodeBuffer& gb, MovementState& ms) noexcept
31283129
{
31293130
ms.SetDefaults(numTotalAxes);
@@ -3135,6 +3136,9 @@ void GCodes::TravelToStartPoint(GCodeBuffer& gb, MovementState& ms) noexcept
31353136
ms.feedRate = gb.ConvertSpeed(rp.originalFeedRate, true);
31363137
ms.movementTool = ms.currentTool;
31373138
ms.linearAxesMentioned = ms.rotationalAxesMentioned = true; // assume that both linear and rotational axes might be moving
3139+
#if SUPPORT_ASYNC_MOVES
3140+
ms.AllocateAxes(rp.axesAndExtrudersOwned, ParameterLettersBitmap());
3141+
#endif
31383142
NewSegmentableMoveAvailable(ms);
31393143
}
31403144

src/GCodes/RestorePoint.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class RestorePoint INHERIT_OBJECT_MODEL
2222
float initialUserC0, initialUserC1; // If we paused during an arc move and proportionDone is nonzero, the X and Y user coordinates at the start of the move
2323
int toolNumber; // The tool number that was active
2424
float fanSpeed; // the last fan speed that was set by M106 with no P parameter
25+
#if SUPPORT_ASYNC_MOVES
26+
AxesBitmap axesAndExtrudersOwned; // axes and extruders that this movement system owned when we saved the restore point. Only used when resuming after skipped objects.
27+
#endif
2528

2629
#if SUPPORT_LASER || SUPPORT_IOBITS
2730
LaserPwmOrIoBits laserPwmOrIoBits; // The output port bits setting for this move, or the laser power

src/Movement/RawMove.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ void MovementState::SavePosition(unsigned int restorePointNumber, size_t numAxes
202202
rp.toolNumber = GetCurrentToolNumber();
203203
rp.fanSpeed = virtualFanSpeed;
204204

205+
#if SUPPORT_ASYNC_MOVES
206+
rp.axesAndExtrudersOwned = axesAndExtrudersOwned;
207+
#endif
205208
#if SUPPORT_LASER || SUPPORT_IOBITS
206209
rp.laserPwmOrIoBits = laserPwmOrIoBits;
207210
#endif

0 commit comments

Comments
 (0)