From 7d8e9a50e11d65846f81b52e36293c5fad7ebec2 Mon Sep 17 00:00:00 2001 From: Tim Evers Date: Thu, 26 Mar 2020 23:32:34 +0100 Subject: [PATCH] Adding debug print out --- src/F11Handler.cpp | 17 ++++++++++++++++- src/F12Handler.cpp | 17 ++++++++++++++++- src/F13Handler.cpp | 17 ++++++++++++++++- src/Movement.cpp | 1 - 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/F11Handler.cpp b/src/F11Handler.cpp index dc44c4e..f2bead8 100644 --- a/src/F11Handler.cpp +++ b/src/F11Handler.cpp @@ -32,7 +32,7 @@ int F11Handler::execute(Command *command) } int homeIsUp = ParameterList::getInstance()->getValue(MOVEMENT_HOME_UP_X); - int A = 10 * CurrentState::getInstance()->getStepsPerMmX(); // move away coordinates + int A = 10; // move away coordinates int execution; bool emergencyStop; @@ -71,6 +71,21 @@ int F11Handler::execute(Command *command) emergencyStop = CurrentState::getInstance()->isEmergencyStop(); if (emergencyStop || execution != 0) { break; } + Serial.print("R99 homing displaced"); + Serial.print(" X "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsX()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsXscaled()); + Serial.print(" Y "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsY()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsYscaled()); + Serial.print(" Z "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsZ()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsZscaled()); + Serial.print("\r\n"); + // Home position cannot drift more than 5 milimeter otherwise no valid home pos if (CurrentState::getInstance()->getHomeMissedStepsXscaled() < 5) { diff --git a/src/F12Handler.cpp b/src/F12Handler.cpp index e669085..a11ca86 100644 --- a/src/F12Handler.cpp +++ b/src/F12Handler.cpp @@ -32,7 +32,7 @@ int F12Handler::execute(Command *command) } int homeIsUp = ParameterList::getInstance()->getValue(MOVEMENT_HOME_UP_Y); - int A = 10 * CurrentState::getInstance()->getStepsPerMmY(); // move away coordinates + int A = 10; // move away coordinates int execution; bool emergencyStop; bool homingComplete = false; @@ -72,6 +72,21 @@ int F12Handler::execute(Command *command) emergencyStop = CurrentState::getInstance()->isEmergencyStop(); if (emergencyStop || execution != 0) { break; } + Serial.print("R99 homing displaced"); + Serial.print(" X "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsX()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsXscaled()); + Serial.print(" Y "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsY()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsYscaled()); + Serial.print(" Z "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsZ()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsZscaled()); + Serial.print("\r\n"); + // Compare postition before and after verify homing if (CurrentState::getInstance()->getHomeMissedStepsYscaled() < 5) { diff --git a/src/F13Handler.cpp b/src/F13Handler.cpp index 567dc5a..9ec5465 100644 --- a/src/F13Handler.cpp +++ b/src/F13Handler.cpp @@ -34,7 +34,7 @@ int F13Handler::execute(Command *command) Movement::getInstance()->moveToCoords(0, 0, 0, 0, 0, 0, false, false, true); int homeIsUp = ParameterList::getInstance()->getValue(MOVEMENT_HOME_UP_Z); - int A = 10 * CurrentState::getInstance()->getStepsPerMmZ(); // move away coordinates + int A = 10; // move away coordinates int execution; bool emergencyStop; @@ -73,6 +73,21 @@ int F13Handler::execute(Command *command) emergencyStop = CurrentState::getInstance()->isEmergencyStop(); if (emergencyStop || execution != 0) { break; } + Serial.print("R99 homing displaced"); + Serial.print(" X "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsX()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsXscaled()); + Serial.print(" Y "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsY()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsYscaled()); + Serial.print(" Z "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsZ()); + Serial.print(" / "); + Serial.print(CurrentState::getInstance()->getHomeMissedStepsZscaled()); + Serial.print("\r\n"); + // Compare postition before and after verify homing if (CurrentState::getInstance()->getHomeMissedStepsZscaled() < 5) { diff --git a/src/Movement.cpp b/src/Movement.cpp index 4594ed9..dc185ae 100644 --- a/src/Movement.cpp +++ b/src/Movement.cpp @@ -428,7 +428,6 @@ int Movement::moveToCoords(double xDestScaled, double yDestScaled, double zDestS long homeMissedSteps[3] = { 0, 0, 0 }; - motorConsMissedSteps[0] = 0; motorConsMissedSteps[1] = 0; motorConsMissedSteps[2] = 0;