diff --git a/Changelog.md b/Changelog.md index f8fb89ae..32c3e3f9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +**V1.13.9 - Updates** +- Added guide logging support. +- Fixed some Meade documentation errors. +- Adjusted DEC limits for OAM to 135 degrees. +- Reverted OLED library for InfoDisplay back to forked version so it compiles correctly. + **V1.13.8 - Updates** - Fixed DEC runaway issue by updating avr-interrupt-stepper library to version 0.0.3 diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index ec68b723..e03ec5a4 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -233,14 +233,14 @@ #ifndef DEC_LIMIT_UP #ifdef OAM - #define DEC_LIMIT_UP 100.0f + #define DEC_LIMIT_UP 135.0f #else #define DEC_LIMIT_UP 0.0f #endif #endif #ifndef DEC_LIMIT_DOWN #ifdef OAM - #define DEC_LIMIT_DOWN 100.0f + #define DEC_LIMIT_DOWN 135.0f #else #define DEC_LIMIT_DOWN 0.0f #endif diff --git a/Constants.hpp b/Constants.hpp index 1a5387a3..30dc104c 100644 --- a/Constants.hpp +++ b/Constants.hpp @@ -92,4 +92,5 @@ #define DEBUG_FOCUS 0x1000 // Focuser activity #define DEBUG_COORD_CALC 0x2000 // Calculations of coordinates #define DEBUG_DISPLAY 0x4000 // Info display +#define DEBUG_GUIDE 0x8000 // Guiding info #define DEBUG_ANY 0xFFFF // All debug output diff --git a/Version.h b/Version.h index 346401c5..c65ec5df 100644 --- a/Version.h +++ b/Version.h @@ -3,4 +3,4 @@ // Also, numbers are interpreted as simple numbers. _ __ _ // So 1.8 is actually 1.08, meaning that 1.12 is a later version than 1.8. \_(..)_/ -#define VERSION "V1.13.8" +#define VERSION "V1.13.9" diff --git a/platformio.ini b/platformio.ini index 38984a0f..41275894 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ lib_deps = arduino-libraries/LiquidCrystal @ ^1.0.7 lincomatic/LiquidTWI2@^1.2.7 olikraus/U8g2@^2.28.8 - https://github.com/ThingPulse/esp8266-oled-ssd1306@4.6.1 + https://github.com/ClutchplateDude/esp8266-oled-ssd1306@4.6.0 [env] extra_scripts = @@ -95,7 +95,7 @@ debug_build_flags = lib_deps = ${common.lib_deps} jdolinay/avr-debugger @ 1.2 - https://github.com/andre-stefanov/avr-interrupt-stepper@0.0.3 + https://github.com/andre-stefanov/avr-interrupt-stepper@0.0.4 [env:mksgenlv21] extends = env:ramps diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index 47f9f2e2..64630108 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -500,7 +500,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // "x" is the stepper to move (r for RA, d for DEC, f for FOC, z for AZ, t for ALT) // "nnnn" is the number of steps // Returns: -// "1" if successfully scheduled +// "1" if successfully scheduled, else "0" // // :MHRxn# // Description: @@ -743,7 +743,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // one Hall sensor based autohoming axis is enabled. // Returns: // "rastate|decstate#" if either axis is enabled -// "|" if no autohoming is enabled +// "|#" if no autohoming is enabled // Remarks: // While the mount status (:GX#) is 'Homing', the command returns one of these: // MOVE_OFF @@ -935,7 +935,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // Information: // Get the current LST of the mount. // Returns: -// "HHMMSS" +// "HHMMSS#" // // :XSBn# // Description: @@ -1856,23 +1856,23 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) { if (inCmd.length() > 2) { - LOG(DEBUG_MOUNT, "[MEADE]: XGH -> %s", inCmd.c_str()); + LOG(DEBUG_MEADE, "[MEADE]: XGH -> %s", inCmd.c_str()); if (inCmd[2] == 'R') // :XGHR# { - LOG(DEBUG_MOUNT, "[MEADE]: XGHR -> %s", inCmd.c_str()); + LOG(DEBUG_MEADE, "[MEADE]: XGHR -> %s", inCmd.c_str()); return String(_mount->getHomingOffset(StepperAxis::RA_STEPS)) + "#"; } else if (inCmd[2] == 'D') // :XGHD# { - LOG(DEBUG_MOUNT, "[MEADE]: XGHD -> %s", inCmd.c_str()); + LOG(DEBUG_MEADE, "[MEADE]: XGHD -> %s", inCmd.c_str()); return String(_mount->getHomingOffset(StepperAxis::DEC_STEPS)) + "#"; } else if (inCmd[2] == 'S') // :XGHS# { - LOG(DEBUG_MOUNT, "[MEADE]: XGHS -> %s", inCmd.c_str()); + LOG(DEBUG_MEADE, "[MEADE]: XGHS -> %s", inCmd.c_str()); return String(inNorthernHemisphere ? "N#" : "S#"); } - LOG(DEBUG_MOUNT, "[MEADE]: XGH? -> %s", inCmd.c_str()); + LOG(DEBUG_MEADE, "[MEADE]: XGH? -> %s", inCmd.c_str()); return "0#"; } diff --git a/src/Mount.cpp b/src/Mount.cpp index d47da2d7..df08c11c 100644 --- a/src/Mount.cpp +++ b/src/Mount.cpp @@ -343,6 +343,7 @@ void Mount::configureDECStepper(byte pin1, byte pin2, uint32_t maxSpeed, uint32_ _stepperDEC->setPinsInverted(true, false, false); _stepperGUIDE->setPinsInverted(true, false, false); #endif + _stepperGUIDE->setCurrentPosition(0); } ///////////////////////////////// @@ -1540,14 +1541,17 @@ void Mount::stopGuiding(bool ra, bool dec) // Stop RA guide first, since it's just a speed change back to tracking speed if (ra && (_mountStatus & STATUS_GUIDE_PULSE_RA)) { - LOG(DEBUG_STEPPERS, "[STEPPERS]: stopGuiding(RA): TRK.setSpeed(%f)", _trackingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, + "[GUIDE]: stopGuide: RA set speed : %f (at %l)", + _trackingSpeed, + _stepperTRK->currentPosition()); _stepperTRK->setSpeed(_trackingSpeed); _mountStatus &= ~STATUS_GUIDE_PULSE_RA; } if (dec && (_mountStatus & STATUS_GUIDE_PULSE_DEC)) { - LOG(DEBUG_STEPPERS, "[STEPPERS]: stopGuiding(DEC): Stop motor"); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: stopGuide: DEC stop guide at : %l", _stepperGUIDE->currentPosition()); // Stop DEC guiding and wait for it to stop. _stepperGUIDE->stop(); @@ -1558,16 +1562,20 @@ void Mount::stopGuiding(bool ra, bool dec) _stepperTRK->runSpeed(); } - LOG(DEBUG_STEPPERS, "[STEPPERS]: stopGuiding(DEC): GuideStepper stopped at %l", _stepperGUIDE->currentPosition()); - + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: stopGuide: DEC stopped at : %l", _stepperGUIDE->currentPosition()); _mountStatus &= ~STATUS_GUIDE_PULSE_DEC; } //disable pulse state if no direction is active if ((_mountStatus & STATUS_GUIDE_PULSE_DIR) == 0) { + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: Clear guiding state"); _mountStatus &= ~STATUS_GUIDE_PULSE_MASK; } + else + { + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: One axis still guiding"); + } } ///////////////////////////////// @@ -1577,7 +1585,26 @@ void Mount::stopGuiding(bool ra, bool dec) ///////////////////////////////// void Mount::guidePulse(byte direction, int duration) { - LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: > Guide Pulse %d for %dms", direction, duration); +#if (DEBUG_LEVEL & (DEBUG_STEPPERS | DEBUG_GUIDE)) + const char *directionName = "-NE-S---W"; +#endif + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: > Guide Pulse %c for %dms", directionName[direction], duration); + if ((direction == NORTH) || (direction == SOUTH)) + { + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC current steps : %l", _stepperGUIDE->currentPosition()); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC steps/deg : %f", _stepsPerDECDegree); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, + "[GUIDE]: guidePulse: DEC Microstep ratio : %f", + (DEC_GUIDE_MICROSTEPPING / DEC_SLEW_MICROSTEPPING)); + } + else + { + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA current steps : %l", _stepperTRK->currentPosition()); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA steps/deg : %f", _stepsPerRADegree); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, + "[GUIDE]: guidePulse: RA Microstep ratio : %f", + (RA_TRACKING_MICROSTEPPING / RA_SLEW_MICROSTEPPING)); + } // DEC stepper moves at sidereal rate in both directions // RA stepper moves at either 2.5x sidereal rate or 0.5x sidereal rate. @@ -1586,7 +1613,6 @@ void Mount::guidePulse(byte direction, int duration) / 3600.0f; // u-steps/deg * deg/hr / sec/hr = u-steps/sec float raGuidingSpeed = _stepsPerRADegree * (RA_TRACKING_MICROSTEPPING / RA_SLEW_MICROSTEPPING) * siderealDegreesInHour / 3600.0f; // u-steps/deg * deg/hr / sec/hr = u-steps/sec - raGuidingSpeed *= _trackingSpeedCalibration; // TODO: Do we need to track how many steps the steppers took and add them to the GoHome calculation? // If so, we need to remember where we were when we started the guide pulse. Then at the end, @@ -1596,14 +1622,16 @@ void Mount::guidePulse(byte direction, int duration) switch (direction) { case NORTH: - LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: DEC.setSpeed(%f)", DEC_PULSE_MULTIPLIER * decGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC guide speed : %f", DEC_PULSE_MULTIPLIER * decGuidingSpeed); _stepperGUIDE->setSpeed(DEC_PULSE_MULTIPLIER * decGuidingSpeed); _mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC; _guideDecEndTime = millis() + duration; break; case SOUTH: - LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: DEC.setSpeed(%f)", -DEC_PULSE_MULTIPLIER * decGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC guide speed : %f", -DEC_PULSE_MULTIPLIER * decGuidingSpeed); _stepperGUIDE->setSpeed(-DEC_PULSE_MULTIPLIER * decGuidingSpeed); _mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC; _guideDecEndTime = millis() + duration; @@ -1611,7 +1639,14 @@ void Mount::guidePulse(byte direction, int duration) case WEST: // We were in tracking mode before guiding, so no need to update microstepping mode on RA driver - LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: TRK.setSpeed(%f)", (RA_PULSE_MULTIPLIER * raGuidingSpeed)); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA base speed : %f", raGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA speed factor : %f", _trackingSpeedCalibration); + raGuidingSpeed *= _trackingSpeedCalibration; + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA adjusted speed : %f", raGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, + "[GUIDE]: guidePulse: RA guide speed : %f (%f x adjusted speed)", + (RA_PULSE_MULTIPLIER * raGuidingSpeed), + RA_PULSE_MULTIPLIER); _stepperTRK->setSpeed(RA_PULSE_MULTIPLIER * raGuidingSpeed); // Faster than siderael _mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_RA; _guideRaEndTime = millis() + duration; @@ -1619,7 +1654,14 @@ void Mount::guidePulse(byte direction, int duration) case EAST: // We were in tracking mode before guiding, so no need to update microstepping mode on RA driver - LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: TRK.setSpeed(%f)", (raGuidingSpeed * (2.0f - RA_PULSE_MULTIPLIER))); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA base speed : %f", raGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA speed factor : %f", _trackingSpeedCalibration); + raGuidingSpeed *= _trackingSpeedCalibration; + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA adjusted speed : %f", raGuidingSpeed); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, + "[GUIDE]: guidePulse: RA guide speed : %f (%f x adjusted speed)", + (2.0 - RA_PULSE_MULTIPLIER * raGuidingSpeed), + (2.0 - RA_PULSE_MULTIPLIER)); _stepperTRK->setSpeed(raGuidingSpeed * (2.0f - RA_PULSE_MULTIPLIER)); // Slower than siderael _mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_RA; _guideRaEndTime = millis() + duration; @@ -1630,7 +1672,7 @@ void Mount::guidePulse(byte direction, int duration) updateInfoDisplay(); #endif - LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: < Guide Pulse"); + LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: < Guide Pulse"); } /////////////////////////////////