Rename variables in leveling steam to help debug z lift problem
This commit is contained in:
parent
1e8fb3a3f3
commit
6be39744d2
2 changed files with 20 additions and 17 deletions
|
|
@ -51,13 +51,13 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
{
|
||||
get
|
||||
{
|
||||
return $"Last Destination = {lastUnleveledDestination}";
|
||||
return $"Last Destination = {inputUnleveled}";
|
||||
}
|
||||
}
|
||||
|
||||
public bool AllowLeveling { get; set; }
|
||||
|
||||
private PrinterMove lastUnleveledDestination = PrinterMove.Unknown;
|
||||
private PrinterMove inputUnleveled = PrinterMove.Unknown;
|
||||
|
||||
private bool LevelingActive
|
||||
{
|
||||
|
|
@ -96,12 +96,12 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
{
|
||||
if (LineIsMovement(lineToSend))
|
||||
{
|
||||
PrinterMove currentUnleveledDestination = GetPosition(lineToSend, lastUnleveledDestination);
|
||||
PrinterMove currentUnleveledDestination = GetPosition(lineToSend, inputUnleveled);
|
||||
var leveledLine = GetLeveledPosition(lineToSend, currentUnleveledDestination);
|
||||
|
||||
// TODO: clamp to 0 - baby stepping - extruder z-offset, so we don't go below the bed (for the active extruder)
|
||||
|
||||
lastUnleveledDestination = currentUnleveledDestination;
|
||||
inputUnleveled = currentUnleveledDestination;
|
||||
|
||||
return leveledLine;
|
||||
}
|
||||
|
|
@ -115,30 +115,33 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
return lineToSend;
|
||||
}
|
||||
|
||||
public override void SetPrinterPosition(PrinterMove position)
|
||||
public override void SetPrinterPosition(PrinterMove outputPosition)
|
||||
{
|
||||
this.lastUnleveledDestination.CopyKnowSettings(position);
|
||||
var outputWithLeveling = PrinterMove.Unknown;
|
||||
|
||||
outputWithLeveling.CopyKnowSettings(outputPosition);
|
||||
|
||||
if (LevelingActive
|
||||
&& position.PositionFullyKnown)
|
||||
&& outputPosition.PositionFullyKnown)
|
||||
{
|
||||
string lineBeingSent = CreateMovementLine(position);
|
||||
string leveledPosition = GetLeveledPosition(lineBeingSent, position);
|
||||
string expectedOutput = CreateMovementLine(outputPosition);
|
||||
string doubleLeveledOutput = GetLeveledPosition(expectedOutput, outputPosition);
|
||||
|
||||
PrinterMove leveledDestination = GetPosition(leveledPosition, PrinterMove.Unknown);
|
||||
PrinterMove deltaToLeveledPosition = leveledDestination - position;
|
||||
PrinterMove doubleLeveledDestination = GetPosition(doubleLeveledOutput, PrinterMove.Unknown);
|
||||
PrinterMove deltaToLeveledPosition = doubleLeveledDestination - outputPosition;
|
||||
|
||||
PrinterMove withLevelingOffset = position - deltaToLeveledPosition;
|
||||
this.inputUnleveled = outputPosition - deltaToLeveledPosition;
|
||||
|
||||
// clean up settings that we don't want to be subtracted
|
||||
withLevelingOffset.extrusion = position.extrusion;
|
||||
withLevelingOffset.feedRate = position.feedRate;
|
||||
this.inputUnleveled.extrusion = outputPosition.extrusion;
|
||||
this.inputUnleveled.feedRate = outputPosition.feedRate;
|
||||
|
||||
internalStream.SetPrinterPosition(withLevelingOffset);
|
||||
internalStream.SetPrinterPosition(this.inputUnleveled);
|
||||
}
|
||||
else
|
||||
{
|
||||
internalStream.SetPrinterPosition(position);
|
||||
this.inputUnleveled = outputPosition;
|
||||
internalStream.SetPrinterPosition(this.inputUnleveled);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit f78e55d7e1f027eafd9c6808bbb3587f3b0abda4
|
||||
Subproject commit ec4418507d52b967f580248c5b077929ece3afd9
|
||||
Loading…
Add table
Add a link
Reference in a new issue