From a58fb49baa13f45e0c7d6b603e98127b9911000d Mon Sep 17 00:00:00 2001 From: Fabian Uehleke Date: Tue, 3 Jun 2025 09:09:13 +0200 Subject: [PATCH 01/15] add OAE config --- Changelog.md | 3 + Configuration.hpp | 2 + ConfigurationValidation.hpp | 18 ++-- Configuration_adv.hpp | 21 +---- Constants.hpp | 1 + Version.h | 2 +- boards/ESP32_ESP32DEV/pins_OAE_V1.hpp | 124 ++++++++++++++++++++++++++ platformio.ini | 6 ++ src/Mount.cpp | 20 +++-- src/Mount.hpp | 3 +- src/b_setup.hpp | 5 ++ 11 files changed, 173 insertions(+), 32 deletions(-) create mode 100644 boards/ESP32_ESP32DEV/pins_OAE_V1.hpp diff --git a/Changelog.md b/Changelog.md index 659ee6fe..7e7e04ba 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,6 @@ +**V1.13.15 - Updates** + - changes necessary for OAE, add OAE baord + **V1.13.15 - Updates** - Check `INFO_DISPLAY_TYPE` builds in CI - Fix `INFO_DISPLAY_TYPE_I2C_SSD1306_128x64` for esp32 builds diff --git a/Configuration.hpp b/Configuration.hpp index 95585a71..a62e5c50 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -260,6 +260,8 @@ #include "boards/RAMPS/pins_RAMPS.hpp" #elif (BOARD == BOARD_ESP32_ESP32DEV) #include "boards/ESP32_ESP32DEV/pins_ESP32DEV.hpp" +#elif (BOARD == BOARD_OAE_V1) + #include "boards/ESP32_ESP32DEV/pins_OAE_V1.hpp" #elif (BOARD == BOARD_AVR_MKS_GEN_L_V1) #include "boards/AVR_MKS_GEN_L_V1/pins_MKS_GEN_L_V1.h" #elif (BOARD == BOARD_AVR_MKS_GEN_L_V2) diff --git a/ConfigurationValidation.hpp b/ConfigurationValidation.hpp index 6660e854..74667a10 100644 --- a/ConfigurationValidation.hpp +++ b/ConfigurationValidation.hpp @@ -89,6 +89,9 @@ #error AZ driver address for DRIVER_TYPE_TMC2209_UART not specified. #endif #endif +#elif defined(BOARD_OAE_V1) + // Valid + #else #error Configuration does not support AZ. Use at own risk. @@ -110,6 +113,9 @@ #endif #endif +#elif defined(BOARD_OAE_V1) + // Valid + #else #warning Configuration does not support ALT. Use at own risk. #endif @@ -193,7 +199,7 @@ #warning Missing pin assignments for MS pins #endif #elif (DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) - #if !defined(DEC_STEP_PIN) || !defined(DEC_DIR_PIN) || !defined(DEC_EN_PIN) || !defined(DEC_DIAG_PIN) + #if !defined(DEC_STEP_PIN) || !defined(DEC_DIR_PIN) || !defined(DEC_EN_PIN) // Required pin assignments missing #error Missing pin assignments for configured DEC DRIVER_TYPE_TMC2209_UART driver #endif @@ -213,7 +219,7 @@ #warning Missing pin assignments for MS pins #endif #elif (RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) - #if !defined(RA_STEP_PIN) || !defined(RA_DIR_PIN) || !defined(RA_EN_PIN) || !defined(RA_DIAG_PIN) + #if !defined(RA_STEP_PIN) || !defined(RA_DIR_PIN) || !defined(RA_EN_PIN) // Required pin assignments missing #error Missing pin assignments for configured RA DRIVER_TYPE_TMC2209_UART driver #endif @@ -225,12 +231,12 @@ #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) #if (AZ_DRIVER_TYPE == DRIVER_TYPE_A4988_GENERIC) || (AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_STANDALONE) - #if !defined(AZ_STEP_PIN) || !defined(AZ_DIR_PIN) || !defined(AZ_EN_PIN) || !defined(AZ_DIAG_PIN) + #if !defined(AZ_STEP_PIN) || !defined(AZ_DIR_PIN) || !defined(AZ_EN_PIN) // Required pin assignments missing #error Missing pin assignments for configured AZ DRIVER_TYPE_A4988_GENERIC or DRIVER_TYPE_TMC2209_STANDALONE driver #endif #elif (AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) - #if !defined(AZ_STEP_PIN) || !defined(AZ_DIR_PIN) || !defined(AZ_EN_PIN) || !defined(AZ_DIAG_PIN) + #if !defined(AZ_STEP_PIN) || !defined(AZ_DIR_PIN) || !defined(AZ_EN_PIN) // Required pin assignments missing (ATmega uses SoftwareSerial for this driver) #error Missing pin assignments for configured AZ DRIVER_TYPE_TMC2209_UART driver #endif @@ -243,12 +249,12 @@ #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) #if (ALT_DRIVER_TYPE == DRIVER_TYPE_A4988_GENERIC) || (ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_STANDALONE) - #if !defined(ALT_STEP_PIN) || !defined(ALT_DIR_PIN) || !defined(ALT_EN_PIN) || !defined(ALT_DIAG_PIN) + #if !defined(ALT_STEP_PIN) || !defined(ALT_DIR_PIN) || !defined(ALT_EN_PIN) // Required pin assignments missing #error Missing pin assignments for configured AZ DRIVER_TYPE_A4988_GENERIC or DRIVER_TYPE_TMC2209_STANDALONE driver #endif #elif (ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) - #if !defined(ALT_STEP_PIN) || !defined(ALT_DIR_PIN) || !defined(ALT_EN_PIN) || !defined(ALT_DIAG_PIN) + #if !defined(ALT_STEP_PIN) || !defined(ALT_DIR_PIN) || !defined(ALT_EN_PIN) // Required pin assignments missing (ATmega uses SoftwareSerial for this driver) #error Missing pin assignments for configured ALT DRIVER_TYPE_TMC2209_UART driver #endif diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index e03ec5a4..0de0b148 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -341,7 +341,10 @@ (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / (AZ_PULLEY_TEETH * GT2_BELT_PITCH)) * AZ_STEPPER_SPR \ * AZ_MICROSTEPPING) // Actually u-steps/rev #endif - #define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps + + #ifndef AZIMUTH_STEPS_PER_ARC_MINUTE + #define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps + #endif // AZ TMC2209 UART settings // These settings work only with TMC2209 in UART connection (single wire to TX) @@ -618,22 +621,6 @@ // //////// //////////////////////////////////////////// -// Stepper drivers -#if (RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) - #if defined(ESP32) - #define RA_SERIAL_PORT Serial2 // Can be shared with DEC_SERIAL_PORT - #elif defined(__AVR_ATmega2560__) - // Uses SoftwareSerial - #endif -#endif - -#if (DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) - #if defined(ESP32) - #define DEC_SERIAL_PORT Serial2 // Can be shared with RA_SERIAL_PORT - #elif defined(__AVR_ATmega2560__) - // Uses SoftwareSerial - #endif -#endif // Focuser #if (FOCUS_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) diff --git a/Constants.hpp b/Constants.hpp index 30dc104c..17c00429 100644 --- a/Constants.hpp +++ b/Constants.hpp @@ -18,6 +18,7 @@ // ESP32 based boards #define BOARD_ESP32_ESP32DEV 1001 +#define BOARD_OAE_V1 1002 /** * Supported keypad/display types. Use one of these values for DISPLAY_TYPE configuration matching your used display and keypad. diff --git a/Version.h b/Version.h index 81278909..e069b894 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.15" +#define VERSION "V1.13.16" diff --git a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp new file mode 100644 index 00000000..2b1de9ab --- /dev/null +++ b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp @@ -0,0 +1,124 @@ +/** + * @brief a pins configuration file for an OAE board v1.0 + */ + +#pragma once + +/** + * @brief a pins configuration file for an ESP32-based OAT. + */ + +#pragma once + +// DRIVER_TYPE_TMC2209_UART requires 4 digital pins in Arduino pin numbering +#ifndef RA_STEP_PIN + #define RA_STEP_PIN 14 // STEP +#endif +#ifndef RA_DIR_PIN + #define RA_DIR_PIN 26 // DIR +#endif +#ifndef RA_EN_PIN + #define RA_EN_PIN 27 // Enable +#endif + +// DRIVER_TYPE_TMC2209_UART HardwareSerial port, can be shared across all drivers +#ifndef RA_SERIAL_PORT + #define RA_SERIAL_PORT Serial1 +#endif +#ifndef RA_DRIVER_ADDRESS + #define RA_DRIVER_ADDRESS 0b00 // Set by MS1/MS2. LOW/LOW in this case +#endif +// DRIVER_TYPE_TMC2209_UART requires 4 digital pins in Arduino pin numbering +#ifndef DEC_STEP_PIN + #define DEC_STEP_PIN 25 // STEP +#endif +#ifndef DEC_DIR_PIN + #define DEC_DIR_PIN 5 // DIR +#endif +#ifndef DEC_EN_PIN + #define DEC_EN_PIN 33 // Enable +#endif + +// DRIVER_TYPE_TMC2209_UART HardwareSerial port, can be shared across all drivers +#ifndef DEC_SERIAL_PORT + #define DEC_SERIAL_PORT Serial1 // SoftwareSerial TX port +#endif +#ifndef DEC_DRIVER_ADDRESS + #define DEC_DRIVER_ADDRESS 0b01 // Set by MS1/MS2 (MS1 HIGH, MS2 LOW) +#endif + +#define SW_SERIAL_UART 0 + +#ifndef ALT_STEP_PIN + #define ALT_STEP_PIN 13 // STEP +#endif +#ifndef ALT_DIR_PIN + #define ALT_DIR_PIN 23 // DIR +#endif +#ifndef ALT_EN_PIN + #define ALT_EN_PIN 4 // Enable +#endif + +#ifndef AZ_STEP_PIN + #define AZ_STEP_PIN 18 // STEP +#endif +#ifndef AZ_DIR_PIN + #define AZ_DIR_PIN 19 // DIR +#endif +#ifndef AZ_EN_PIN + #define AZ_EN_PIN 32 // Enable +#endif + +// DISPLAY_TYPE_LCD_JOY_I2C_SSD1306 requires 3 analog inputs in Arduino pin numbering +#ifndef LCD_KEY_SENSE_X_PIN + //#define LCD_KEY_SENSE_X_PIN 34 +#endif +#ifndef LCD_KEY_SENSE_Y_PIN + //#define LCD_KEY_SENSE_Y_PIN 39 +#endif +#ifndef LCD_KEY_SENSE_PUSH_PIN + //#define LCD_KEY_SENSE_PUSH_PIN 36 +#endif + +//Serial port for external debugging +#if DEBUG_SEPARATE_SERIAL == 1 + #ifndef DEBUG_SERIAL_PORT + #error "There is no default separate serial port for ESP32, please define DEBUG_SERIAL_PORT" + #endif +#else + #ifndef DEBUG_SERIAL_PORT + #define DEBUG_SERIAL_PORT Serial2 + #endif +#endif + + +// Defines for OAE /////////////////////// +#define OAM //enable GEM Motion + +#ifndef RA_WHEEL_CIRCUMFERENCE + #define RA_WHEEL_CIRCUMFERENCE 704.97f +#endif +#ifndef DEC_TRANSMISSION + #define DEC_TRANSMISSION (DEC_WHEEL_CIRCUMFERENCE / (DEC_PULLEY_TEETH * 1.0)) +#endif +#ifndef RA_LIMIT_LEFT + #define RA_LIMIT_LEFT 5.0f +#endif +#ifndef RA_LIMIT_RIGHT + #define RA_LIMIT_RIGHT 7.0f +#endif +#ifndef RA_TRACKING_LIMIT + #define RA_TRACKING_LIMIT 6.75f +#endif +#ifndef DEC_WHEEL_CIRCUMFERENCE + #define DEC_WHEEL_CIRCUMFERENCE 1.0f +#endif +#ifndef RA_STEPPER_SPR + #define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper +#endif +#ifndef DEC_STEPPER_SPR + #define DEC_STEPPER_SPR (200 * 50 * 4.5f) // change to (200 * 9) for 1.8° stepper +#endif +#ifndef DEC_PULLEY_TEETH + #define DEC_PULLEY_TEETH 1 +#endif \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 9f81e979..b23a21da 100644 --- a/platformio.ini +++ b/platformio.ini @@ -128,6 +128,12 @@ lib_deps = ${common.lib_deps} WiFi +[env:oaeboardv1] +extends = env:esp32 +build_flags = + ${env.build_flags} + -D BOARD=BOARD_OAE_V1 -D ESP32BOARD + [env:native] platform = native test_ignore = test_embedded diff --git a/src/Mount.cpp b/src/Mount.cpp index 6ff13987..806d49c9 100644 --- a/src/Mount.cpp +++ b/src/Mount.cpp @@ -1579,11 +1579,14 @@ void Mount::stopGuiding(bool ra, bool dec) // Stop DEC guiding and wait for it to stop. _stepperGUIDE->stop(); + #if !defined(ESP32BOARD) while (_stepperGUIDE->isRunning()) { _stepperGUIDE->run(); _stepperTRK->runSpeed(); } + #endif + _mountStatus &= ~STATUS_GUIDE_PULSE_DEC; } @@ -1880,11 +1883,11 @@ void Mount::getAZALTPositions(long &azPos, long &altPos) void Mount::moveAZALTToHome() { #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) - enableAzAltMotors(); + enableAzMotor(); _stepperAZ->moveTo(0); #endif #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) - enableAzAltMotors(); + enableAltMotor(); _stepperALT->moveTo(0); #endif } @@ -1979,7 +1982,7 @@ void Mount::moveBy(int direction, float arcMinutes) #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) if (direction == AZIMUTH_STEPS) { - enableAzAltMotors(); + enableAzMotor(); long stepsToMove = arcMinutes * AZIMUTH_STEPS_PER_ARC_MINUTE; _stepperAZ->move(stepsToMove); } @@ -1987,7 +1990,7 @@ void Mount::moveBy(int direction, float arcMinutes) #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) if (direction == ALTITUDE_STEPS) { - enableAzAltMotors(); + enableAltMotor(); long stepsToMove = arcMinutes * ALTITUDE_STEPS_PER_ARC_MINUTE; _stepperALT->move(stepsToMove); } @@ -2040,12 +2043,15 @@ void Mount::disableAzAltMotors() // enableAzAltMotors // ///////////////////////////////// -void Mount::enableAzAltMotors() +void Mount::enableAzMotor() { #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) digitalWrite(AZ_EN_PIN, LOW); // Logic LOW to enable driver #endif +} +void Mount::enableAltMotor() +{ #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) digitalWrite(ALT_EN_PIN, LOW); // Logic LOW to enable driver #endif @@ -3692,7 +3698,7 @@ void Mount::moveStepperBy(StepperAxis direction, long steps) case AZIMUTH_STEPS: { #if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE - enableAzAltMotors(); + enableAzMotor(); LOG(DEBUG_STEPPERS, "[STEPPERS]: moveStepperBy: AZ from %l to %l", _stepperAZ->currentPosition(), @@ -3705,7 +3711,7 @@ void Mount::moveStepperBy(StepperAxis direction, long steps) case ALTITUDE_STEPS: { #if ALT_STEPPER_TYPE != STEPPER_TYPE_NONE - enableAzAltMotors(); + enableAltMotor(); _stepperALT->moveTo(_stepperALT->currentPosition() + steps); #endif } diff --git a/src/Mount.hpp b/src/Mount.hpp index 80d53351..1dbb227d 100644 --- a/src/Mount.hpp +++ b/src/Mount.hpp @@ -432,7 +432,8 @@ class Mount // Support for moving the mount in azimuth and altitude (requires extra hardware) void moveBy(int direction, float arcMinutes); void disableAzAltMotors(); - void enableAzAltMotors(); + void enableAzMotor(); + void enableAltMotor(); #endif #if (FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE) diff --git a/src/b_setup.hpp b/src/b_setup.hpp index cd99525e..42b06e16 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -175,7 +175,10 @@ void setup() #endif #if RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART // include TMC2209 UART pins + #if defined(RA_DIAG_PIN) pinMode(RA_DIAG_PIN, INPUT); + #endif + #ifdef RA_SERIAL_PORT RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver #endif @@ -195,7 +198,9 @@ void setup() #endif #if DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART // include TMC2209 UART pins + #if defined(DEC_DIAG_PIN) pinMode(DEC_DIAG_PIN, INPUT); + #endif #ifdef DEC_SERIAL_PORT DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver #endif From 2e58455b4ab13bcbfb78c6226916a09eed0a35ea Mon Sep 17 00:00:00 2001 From: Fabian Uehleke Date: Tue, 3 Jun 2025 09:51:02 +0200 Subject: [PATCH 02/15] RA DEC driver serial connection --- boards/ESP32_ESP32DEV/pins_OAE_V1.hpp | 12 ++++++++++++ src/b_setup.hpp | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp index 2b1de9ab..60d962f8 100644 --- a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp +++ b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp @@ -25,6 +25,12 @@ #ifndef RA_SERIAL_PORT #define RA_SERIAL_PORT Serial1 #endif +#ifndef RA_TX_PIN + #define RA_TX_PIN 17 +#endif +#ifndef RA_RX_PIN + #define RA_RX_PIN 16 +#endif #ifndef RA_DRIVER_ADDRESS #define RA_DRIVER_ADDRESS 0b00 // Set by MS1/MS2. LOW/LOW in this case #endif @@ -43,6 +49,12 @@ #ifndef DEC_SERIAL_PORT #define DEC_SERIAL_PORT Serial1 // SoftwareSerial TX port #endif +#ifndef DEC_TX_PIN + #define DEC_TX_PIN 17 +#endif +#ifndef DEC_RX_PIN + #define DEC_RX_PIN 16 +#endif #ifndef DEC_DRIVER_ADDRESS #define DEC_DRIVER_ADDRESS 0b01 // Set by MS1/MS2 (MS1 HIGH, MS2 LOW) #endif diff --git a/src/b_setup.hpp b/src/b_setup.hpp index 42b06e16..05be1194 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -180,7 +180,12 @@ void setup() #endif #ifdef RA_SERIAL_PORT - RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + #if defined(BOARD_OAE_V1) + RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); + #else + RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + #endif + // #endif #endif pinMode(DEC_EN_PIN, OUTPUT); @@ -199,10 +204,14 @@ void setup() #if DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART // include TMC2209 UART pins #if defined(DEC_DIAG_PIN) - pinMode(DEC_DIAG_PIN, INPUT); + pinMode(DEC_DIAG_PIN, INPUT); #endif #ifdef DEC_SERIAL_PORT - DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + #if defined(BOARD_OAE_V1) + DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); + #else + DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + #endif #endif #endif From e7f41da5a16e0029983f64937e0ae3bc1cf463f1 Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 6 Jul 2025 23:09:08 -0700 Subject: [PATCH 03/15] WIP Updates - OAE support - AZ/ALT debug output - Stop button now stop all motors (incl. AZ and ALT) --- Changelog.md | 4 +-- Configuration_adv.hpp | 63 ++++++++++++++++++++++++---------- src/MeadeCommandProcessor.cpp | 5 ++- src/Mount.cpp | 31 +++++++++++++++-- src/Mount.hpp | 3 ++ src/SSD1306_128x64_Display.hpp | 10 +++--- src/b_setup.hpp | 12 +++++++ src/testmenu.cpp | 14 ++++++-- src/testmenudef.hpp | 2 +- 9 files changed, 112 insertions(+), 32 deletions(-) diff --git a/Changelog.md b/Changelog.md index 7e7e04ba..97924f34 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,5 @@ **V1.13.15 - Updates** - - changes necessary for OAE, add OAE baord - -**V1.13.15 - Updates** +- Changes necessary for OAE, add OAE baord - Check `INFO_DISPLAY_TYPE` builds in CI - Fix `INFO_DISPLAY_TYPE_I2C_SSD1306_128x64` for esp32 builds diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index 0de0b148..df1b12a9 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -232,14 +232,14 @@ #endif #ifndef DEC_LIMIT_UP - #ifdef OAM + #if defined(OAM) || defined(OAE) #define DEC_LIMIT_UP 135.0f #else #define DEC_LIMIT_UP 0.0f #endif #endif #ifndef DEC_LIMIT_DOWN - #ifdef OAM + #if defined(OAM) || defined(OAE) #define DEC_LIMIT_DOWN 135.0f #else #define DEC_LIMIT_DOWN 0.0f @@ -332,14 +332,28 @@ #define AZ_STEPPER_ACCELERATION (100 * AZ_MICROSTEPPING) #endif - // the Circumference of the AZ rotation. 808mm dia. + // the Circumference of the AZ rotation. 808mm dia (OAT) #ifndef AZ_CIRCUMFERENCE - #define AZ_CIRCUMFERENCE 2538.4f + #ifdef OAE + // Roughly from the joint to the rod placement is 70mm + #define AZ_CIRCUMFERENCE 70.0f * 2 * PI + #else + #define AZ_CIRCUMFERENCE 2538.4f + #endif #endif + + #ifdef OAE + #ifndef AZ_WORMGEAR_RATIO + #define AZ_WORMGEAR_RATIO (40.0f) + #endif + #else + #define AZ_WORMGEAR_RATIO 1.0f + #endif + #ifndef AZIMUTH_STEPS_PER_REV #define AZIMUTH_STEPS_PER_REV \ (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / (AZ_PULLEY_TEETH * GT2_BELT_PITCH)) * AZ_STEPPER_SPR \ - * AZ_MICROSTEPPING) // Actually u-steps/rev + * AZ_MICROSTEPPING * AZ_WORMGEAR_RATIO) // Actually u-steps/rev #endif #ifndef AZIMUTH_STEPS_PER_ARC_MINUTE @@ -398,20 +412,33 @@ #define ALTITUDE_STEPS_PER_REV \ (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev - #else - // the Circumference of the AZ rotation. 770mm dia. - #define ALT_CIRCUMFERENCE 2419.0f - #if AUTOPA_VERSION == 1 - // the ratio of the ALT gearbox for AutoPA V1 (40:3) - #define ALT_WORMGEAR_RATIO (40.0f / 3.0f) + #else + #ifdef OAE + #ifndef ALT_ROD_PITCH + #define ALT_ROD_PITCH 1.25 // mm/rev + #endif + // the Circumference of the ALT rotation. Roughly 146mm radius. + #define ALT_CIRCUMFERENCE 146.0f * 2 * PI + #ifndef ALT_WORMGEAR_RATIO + #define ALT_WORMGEAR_RATIO (40.0f) + #endif + #define ALTITUDE_STEPS_PER_REV + \ + (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING * ALT_WORMGEAR_RATIO) // Actually u-steps/rev #else - // the ratio of the ALT gearbox for AutoPA V2 (40:1) - #define ALT_WORMGEAR_RATIO (40.0f) - #endif - #ifndef ALTITUDE_STEPS_PER_REV - #define ALTITUDE_STEPS_PER_REV \ - (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \ - * ALT_WORMGEAR_RATIO) // Actually u-steps/rev + // the Circumference of the AZ rotation. 770mm dia. + #define ALT_CIRCUMFERENCE 2419.0f + #if AUTOPA_VERSION == 1 + // the ratio of the ALT gearbox for AutoPA V1 (40:3) + #define ALT_WORMGEAR_RATIO (40.0f / 3.0f) + #else + // the ratio of the ALT gearbox for AutoPA V2 (40:1) + #define ALT_WORMGEAR_RATIO (40.0f) + #endif + #ifndef ALTITUDE_STEPS_PER_REV + #define ALTITUDE_STEPS_PER_REV \ + (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \ + * ALT_WORMGEAR_RATIO) // Actually u-steps/rev + #endif #endif #endif diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index e06b984e..84794202 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -2069,7 +2069,10 @@ String MeadeCommandProcessor::handleMeadeQuit(String inCmd) if (inCmd.length() == 0) { _mount->stopSlewing(ALL_DIRECTIONS | TRACKING); - _mount->waitUntilStopped(ALL_DIRECTIONS); + _mount->stopSlewing(AZIMUTH_STEPS); + _mount->stopSlewing(ALTITUDE_STEPS); + _mount->stopSlewing(FOCUS_STEPS); + _mount->waitUntilAllStopped(); return ""; } diff --git a/src/Mount.cpp b/src/Mount.cpp index 806d49c9..e7b3b9e9 100644 --- a/src/Mount.cpp +++ b/src/Mount.cpp @@ -1245,7 +1245,7 @@ void Mount::setLST(const DayTime &lst) { _LST = lst; _zeroPosRA = lst; -#ifdef OAM +#if defined(OAM) || defined(OAE) _zeroPosRA.addHours(6); // shift allcoordinates by 90° for EQ mount movement #endif LOG(DEBUG_MOUNT, "[MOUNT]: Set LST and ZeroPosRA to: %s", _LST.ToString()); @@ -2628,6 +2628,33 @@ void Mount::waitUntilStopped(byte direction) } } +///////////////////////////////// +// +// waitUntilAllStopped +// +///////////////////////////////// +// Block until all steppers are stopped +void Mount::waitUntilAllStopped() +{ + while (_stepperRA->isRunning() + || _stepperDEC->isRunning() + || (((_mountStatus & STATUS_TRACKING) == 0) && _stepperTRK->isRunning()) +#if FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE + || _stepperFocus->isRunning() +#endif +#if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE + || _stepperAZ->isRunning() +#endif +#if ALT_STEPPER_TYPE != STEPPER_TYPE_NONE + || _stepperALT->isRunning() +#endif + ) + { + loop(); + yield(); + } +} + ///////////////////////////////// // // getCurrentStepperPosition @@ -3365,7 +3392,7 @@ void Mount::setHome(bool clearZeroPos) //LOG(DEBUG_MOUNT_VERBOSE, "[MOUNT]: setHomePre: targetRA is %s", targetRA().ToString()); //LOG(DEBUG_MOUNT_VERBOSE, "[MOUNT]: setHomePre: zeroPos is %s", _zeroPosRA.ToString()); _zeroPosRA = clearZeroPos ? DayTime(POLARIS_RA_HOUR, POLARIS_RA_MINUTE, POLARIS_RA_SECOND) : calculateLst(); -#ifdef OAM +#if defined(OAM) || defined(OAE) _zeroPosRA.addHours(6); // shift allcoordinates by 90° for EQ mount movement #endif _zeroPosDEC = 0.0f; diff --git a/src/Mount.hpp b/src/Mount.hpp index 1dbb227d..b84a73c8 100644 --- a/src/Mount.hpp +++ b/src/Mount.hpp @@ -335,6 +335,9 @@ class Mount // Block until the motors specified (NORTH, EAST, TRACKING, etc.) are stopped void waitUntilStopped(byte direction); + // Block until all motors are stopped + void waitUntilAllStopped(); + // Same as Arduino delay() but keeps the tracker going. void delay(int ms); diff --git a/src/SSD1306_128x64_Display.hpp b/src/SSD1306_128x64_Display.hpp index 003f32cc..bb036fee 100644 --- a/src/SSD1306_128x64_Display.hpp +++ b/src/SSD1306_128x64_Display.hpp @@ -23,7 +23,7 @@ const uint8_t sineTable[] PROGMEM = {0, 22, 44, 66, 87, 108, 128, 146, 164, 180, // This class renders the mount status to a 128x64 pixel display controlled by a SSD1306 chip. class SDD1306OLED128x64 : public InfoDisplayRender { -#ifdef OAM +#if defined(OAM) || defined(OAE) const float bottomDEC = -180.0f; const float rangeDEC = 360.0; #else @@ -92,7 +92,9 @@ class SDD1306OLED128x64 : public InfoDisplayRender // Name on the right display->setFont(Bitmap5x7); -#ifdef OAM +#ifdef OAE + display->drawString(32, 6, F("OpenAstroExplorer")); +#elif defined(OAM) display->drawString(32, 6, F("OpenAstroMount")); #else display->drawString(32, 6, F("OpenAstroTracker")); @@ -375,7 +377,7 @@ class SDD1306OLED128x64 : public InfoDisplayRender { display->setPixel(_decScalePos, p); } -#ifdef OAM +#if defined(OAM) || defined(OAE) display->drawHorizontalLine(_decScalePos - 1, yDECPixel(-180.0), 2); #endif display->drawHorizontalLine(_decScalePos - 1, yDECPixel(-90.0), 2); @@ -383,7 +385,7 @@ class SDD1306OLED128x64 : public InfoDisplayRender display->drawHorizontalLine(_decScalePos - 1, yDECPixel(90.0), 2); display->drawHorizontalLine(_decScalePos - 1, yDECPixel(180.0), 2); // DEC tickmark labels -#ifdef OAM +#if defined(OAM) || defined(OAE) display->drawString(_decScalePos + 6, yDECPixel(-180.0f) - 2, F("180")); display->drawHorizontalLine(_decScalePos + 3, yDECPixel(-180.0), 2); // Smaller minus sign #endif diff --git a/src/b_setup.hpp b/src/b_setup.hpp index 05be1194..f3c7f2c6 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -433,6 +433,12 @@ void setup() #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) LOG(DEBUG_ANY, "[STEPPERS]: Configure AZ stepper..."); + LOG(DEBUG_ANY, "[STEPPERS]: AZ Microsteps : %d", AZ_MICROSTEPPING); + LOG(DEBUG_ANY, "[STEPPERS]: AZ Stepper SPR : %d", AZ_STEPPER_SPR); + LOG(DEBUG_ANY, "[STEPPERS]: AZ Circumference : %f", AZ_CIRCUMFERENCE); + LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/rev : %f", AZIMUTH_STEPS_PER_REV); + LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/deg : %f", _stepsPerAZDegree); + LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/minute : %f", AZIMUTH_STEPS_PER_ARC_MINUTE); mount.configureAZStepper(AZmotorPin1, AZmotorPin2, AZ_STEPPER_SPEED, AZ_STEPPER_ACCELERATION); #if AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART LOG(DEBUG_ANY, "[STEPPERS]: Configure AZ driver..."); @@ -445,6 +451,12 @@ void setup() #endif #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) LOG(DEBUG_ANY, "[STEPPERS]: Configure Alt stepper..."); + LOG(DEBUG_ANY, "[STEPPERS]: ALT Microsteps : %d", ALT_MICROSTEPPING); + LOG(DEBUG_ANY, "[STEPPERS]: ALT Stepper SPR : %d", ALT__STEPPER_SPR); + LOG(DEBUG_ANY, "[STEPPERS]: ALT Circumference : %f", ALT_CIRCUMFERENCE); + LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/rev : %f", ALTITUDE_STEPS_PER_REV); + LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/deg : %f", _stepsPerALTDegree); + LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); mount.configureALTStepper(ALTmotorPin1, ALTmotorPin2, ALT_STEPPER_SPEED, ALT_STEPPER_ACCELERATION); #if ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART LOG(DEBUG_ANY, "[STEPPERS]: Configure ALT driver..."); diff --git a/src/testmenu.cpp b/src/testmenu.cpp index 6620f38c..0dcabb51 100644 --- a/src/testmenu.cpp +++ b/src/testmenu.cpp @@ -261,9 +261,13 @@ void TestMenu::listHardware() const int index = 0; Serial.print(F(" Mount: ")); #ifdef OAM - Serial.println(F("OpenAstroMount (OAM)")); + Serial.println(F("OpenAstroMount (OAM)")); #else - Serial.println(F("OpenAstroTracker (OAT)")); + #ifdef OAE + Serial.println(F("OpenAstroExplorer (OAE)")); + #else + Serial.println(F("OpenAstroTracker (OAT)")); + #endif #endif while (p->length() > 0) @@ -529,7 +533,11 @@ void TestMenu::display() const #ifdef OAM Serial.println(F("*** OpenAstroMount (OAM) Test Menu ***")); #else - Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); + #ifdef OAE + Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); + #else + Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); + #endif #endif Serial.print(F("************* ")); Serial.print(freeMemory()); diff --git a/src/testmenudef.hpp b/src/testmenudef.hpp index eb959707..cbf18526 100644 --- a/src/testmenudef.hpp +++ b/src/testmenudef.hpp @@ -68,5 +68,5 @@ TestMenuItem menuItems[] = { TestMenuItem(MENU_FACTORY_RESET), }; -TestMenu mainTestMenu(0, "OAT/OAM Testing menu", "", menuItems, sizeof(menuItems) / sizeof(menuItems[0])); +TestMenu mainTestMenu(0, "OAT/OAM/OAE Testing menu", "", menuItems, sizeof(menuItems) / sizeof(menuItems[0])); #endif \ No newline at end of file From e8ab597243cb84b67baa4a95dc83ffd825265734 Mon Sep 17 00:00:00 2001 From: Lutz Kretzschmar Date: Sat, 12 Jul 2025 23:50:05 -0700 Subject: [PATCH 04/15] WIP --- Configuration_adv.hpp | 2 +- src/MeadeCommandProcessor.cpp | 2 +- src/Mount.cpp | 3 --- src/Mount.hpp | 2 +- src/b_setup.hpp | 4 +--- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index f691e2f6..e3abee7f 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -390,7 +390,7 @@ #define ALT_MICROSTEPPING 4 #endif #ifndef ALT_STEPPER_SPR - #define ALT_STEPPER_SPR 400 // NEMA 0.9° = 400 | NEMA 1.8° = 200 + #define ALT_STEPPER_SPR (400.0) // NEMA 0.9° = 400 | NEMA 1.8° = 200 #endif #ifndef ALT_STEPPER_SPEED #define ALT_STEPPER_SPEED 2000 diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index 84794202..7b5c848a 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -501,7 +501,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // Information: // This starts moving one of the steppers by the given amount of steps and returns immediately. Steps can be positive or negative. // Parameters: -// "x" is the stepper to move (r for RA, d for DEC, f for FOC, z for AZ, t for ALT) +// "x" is the stepper to move (r for RA, d for DEC, f for FOC, z for AZ, l for ALT) // "nnnn" is the number of steps // Returns: // "1" if successfully scheduled, else "0" diff --git a/src/Mount.cpp b/src/Mount.cpp index 132693bd..2bb8d946 100644 --- a/src/Mount.cpp +++ b/src/Mount.cpp @@ -78,9 +78,6 @@ Mount::Mount(LcdMenu *lcdMenu) { _commandReceived = 0; -#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE) - _loops = 0; -#endif _lcdMenu = lcdMenu; initializeVariables(); } diff --git a/src/Mount.hpp b/src/Mount.hpp index b84a73c8..fc897eec 100644 --- a/src/Mount.hpp +++ b/src/Mount.hpp @@ -406,7 +406,7 @@ class Mount void setupInfoDisplay(); void updateInfoDisplay(); InfoDisplayRender *getInfoDisplay(); - long _loops; + long _lastInfoUpdate = 0; // Last time the info display was updated #endif // Called by Meade processor every time a command is received. diff --git a/src/b_setup.hpp b/src/b_setup.hpp index f3c7f2c6..422d85ca 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -437,7 +437,6 @@ void setup() LOG(DEBUG_ANY, "[STEPPERS]: AZ Stepper SPR : %d", AZ_STEPPER_SPR); LOG(DEBUG_ANY, "[STEPPERS]: AZ Circumference : %f", AZ_CIRCUMFERENCE); LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/rev : %f", AZIMUTH_STEPS_PER_REV); - LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/deg : %f", _stepsPerAZDegree); LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/minute : %f", AZIMUTH_STEPS_PER_ARC_MINUTE); mount.configureAZStepper(AZmotorPin1, AZmotorPin2, AZ_STEPPER_SPEED, AZ_STEPPER_ACCELERATION); #if AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART @@ -452,10 +451,9 @@ void setup() #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) LOG(DEBUG_ANY, "[STEPPERS]: Configure Alt stepper..."); LOG(DEBUG_ANY, "[STEPPERS]: ALT Microsteps : %d", ALT_MICROSTEPPING); - LOG(DEBUG_ANY, "[STEPPERS]: ALT Stepper SPR : %d", ALT__STEPPER_SPR); + LOG(DEBUG_ANY, "[STEPPERS]: ALT Stepper SPR : %d", ALT_STEPPER_SPR); LOG(DEBUG_ANY, "[STEPPERS]: ALT Circumference : %f", ALT_CIRCUMFERENCE); LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/rev : %f", ALTITUDE_STEPS_PER_REV); - LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/deg : %f", _stepsPerALTDegree); LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); mount.configureALTStepper(ALTmotorPin1, ALTmotorPin2, ALT_STEPPER_SPEED, ALT_STEPPER_ACCELERATION); #if ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART From 4c9f93892b170811a22e4551e9d0e3483ea318da Mon Sep 17 00:00:00 2001 From: Lutz Date: Fri, 1 Aug 2025 23:38:50 -0700 Subject: [PATCH 05/15] V1.13.17 - Updates - Store AZ/ALT steps per degree and allow them to be set from Meade # Conflicts: # src/b_setup.hpp --- Changelog.md | 5 ++- Version.h | 2 +- src/EPROMStore.cpp | 80 +++++++++++++++++++++++++++++++++++ src/EPROMStore.hpp | 26 ++++++++++-- src/MeadeCommandProcessor.cpp | 56 +++++++++++++++++++++++- src/Mount.cpp | 47 +++++++++++++++++++- src/Mount.hpp | 4 +- src/b_setup.hpp | 2 + 8 files changed, 211 insertions(+), 11 deletions(-) diff --git a/Changelog.md b/Changelog.md index 97924f34..2cda9f2a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,8 @@ +**V1.13.17 - Updates** +- Store AZ/ALT steps per degree and allow them to be set from Meade + **V1.13.15 - Updates** -- Changes necessary for OAE, add OAE baord +- Changes necessary for OAE, add OAE board - Check `INFO_DISPLAY_TYPE` builds in CI - Fix `INFO_DISPLAY_TYPE_I2C_SSD1306_128x64` for esp32 builds diff --git a/Version.h b/Version.h index e069b894..9c9e2e2b 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.16" +#define VERSION "V1.13.17" diff --git a/src/EPROMStore.cpp b/src/EPROMStore.cpp index 97b92e90..bb20c8e0 100644 --- a/src/EPROMStore.cpp +++ b/src/EPROMStore.cpp @@ -141,6 +141,8 @@ void EEPROMStore::displayContents() LOG(DEBUG_INFO, "[EEPROM]: Stored RA Homing Offset: %l", getRAHomingOffset()); LOG(DEBUG_INFO, "[EEPROM]: Stored AZ Position: %l", getAZPosition()); LOG(DEBUG_INFO, "[EEPROM]: Stored ALT Position: %l", getALTPosition()); + LOG(DEBUG_INFO, "[EEPROM]: Stored AZ Steps per Degree: %f", getAZStepsPerDegree()); + LOG(DEBUG_INFO, "[EEPROM]: Stored ALT Steps per Degree: %f", getALTStepsPerDegree()); LOG(DEBUG_INFO, "[EEPROM]: Stored DEC Homing Offset : %l", getDECHomingOffset()); LOG(DEBUG_INFO, "[EEPROM]: Stored DEC Lower Limit: %l", getDECLowerLimit()); LOG(DEBUG_INFO, "[EEPROM]: Stored DEC Upper Limit: %l", getDECUpperLimit()); @@ -463,6 +465,84 @@ void EEPROMStore::storeDECStepsPerDegree(float decStepsPerDegree) commit(); // Complete the transaction } +// Return the AZ steps per degree (actually microsteps per degree). +// If it is not present then the default uncalibrated AZ_STEPS_PER_DEGREE value is returned. +float EEPROMStore::getAZStepsPerDegree() +{ + #if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE + float azStepsPerDegree(AZIMUTH_STEPS_PER_REV / 360); // Default value + #else + float azStepsPerDegree(1); // Default value + #endif + + if (isPresentExtended(AZ_NORM_STEPS_MARKER_FLAG)) + { + // Latest version stores 100x steps/deg for 256 MS + const float factor = SteppingStorageNormalized / AZ_MICROSTEPPING; + azStepsPerDegree = readInt32(AZ_NORM_STEPS_DEGREE_ADDR) / factor; + LOG(DEBUG_EEPROM, "[EEPROM]: AZ Normed Marker Present! AZ steps/deg is %f", azStepsPerDegree); + } + else + { + LOG(DEBUG_EEPROM, "[EEPROM]: No stored value for AZ steps"); + } + + return azStepsPerDegree; // microsteps per degree +} + +// Store the AZ steps per degree (actually microsteps per degree). +void EEPROMStore::storeAZStepsPerDegree(float azStepsPerDegree) +{ + // Store steps as 100x steps/deg at 256 MS. + const float factor = SteppingStorageNormalized / AZ_MICROSTEPPING; + int32_t val = azStepsPerDegree * factor; + LOG(DEBUG_EEPROM, "[EEPROM]: Storing AZ steps to %l (%f)", val, azStepsPerDegree); + + updateInt32(AZ_NORM_STEPS_DEGREE_ADDR, val); + updateFlagsExtended(AZ_NORM_STEPS_MARKER_FLAG); + commit(); // Complete the transaction +} + + +// Return the ALT steps per degree (actually microsteps per degree). +// If it is not present then the default uncalibrated ALT_STEPS_PER_DEGREE value is returned. +float EEPROMStore::getALTStepsPerDegree() +{ + #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + float azStepsPerDegree(ALTITUDE_STEPS_PER_REV / 360); // Default value + #else + float azStepsPerDegree(1); // Default value + #endif + + if (isPresentExtended(ALT_NORM_STEPS_MARKER_FLAG)) + { + // Latest version stores 100x steps/deg for 256 MS + const float factor = SteppingStorageNormalized / ALT_MICROSTEPPING; + azStepsPerDegree = readInt32(ALT_NORM_STEPS_DEGREE_ADDR) / factor; + LOG(DEBUG_EEPROM, "[EEPROM]: ALT Normed Marker Present! ALT steps/deg is %f", azStepsPerDegree); + } + else + { + LOG(DEBUG_EEPROM, "[EEPROM]: No stored value for ALT steps"); + } + + return azStepsPerDegree; // microsteps per degree +} + +// Store the ALT steps per degree (actually microsteps per degree). +void EEPROMStore::storeALTStepsPerDegree(float azStepsPerDegree) +{ + // Store steps as 100x steps/deg at 256 MS. + const float factor = SteppingStorageNormalized / ALT_MICROSTEPPING; + int32_t val = azStepsPerDegree * factor; + LOG(DEBUG_EEPROM, "[EEPROM]: Storing ALT steps to %l (%f)", val, azStepsPerDegree); + + updateInt32(ALT_NORM_STEPS_DEGREE_ADDR, val); + updateFlagsExtended(ALT_NORM_STEPS_MARKER_FLAG); + commit(); // Complete the transaction +} + + int16_t EEPROMStore::getLastFlashedVersion() { if (isPresentExtended(LAST_FLASHED_MARKER_FLAG)) diff --git a/src/EPROMStore.hpp b/src/EPROMStore.hpp index dd943350..506e987c 100644 --- a/src/EPROMStore.hpp +++ b/src/EPROMStore.hpp @@ -29,6 +29,12 @@ class EEPROMStore static float getDECStepsPerDegree(); static void storeDECStepsPerDegree(float decStepsPerDegree); + static float getAZStepsPerDegree(); + static void storeAZStepsPerDegree(float azStepsPerDegree); + + static float getALTStepsPerDegree(); + static void storeALTStepsPerDegree(float altStepsPerDegree); + static float getSpeedFactor(); static void storeSpeedFactor(float speed); @@ -91,13 +97,15 @@ class EEPROMStore // If Location 5 is 0xCF, then an extended 16-bit flag is stored in 21/22 and // indicates the additional fields that have been stored: 0000 0000 0000 0000 // ^^^^ ^^^^ ^^^^ ^^^^ - // || |||| |||| + // |||| |||| |||| + // ALT Steps/deg, normalized to 256MS (70-73) -------------+||| |||| |||| + // AZ Steps/deg, normalized to 256MS (66-69) --------------+|| |||| |||| // ALT position (62-65) ---------------+| |||| |||| // AZ Position (58-61) ----------------+ |||| |||| // Last flashed version (56-57) ------------------+||| |||| // DEC Homing Offet (52-55) -------------------+|| |||| - // DEC Steps/deg, normalized to 256MS (48-51) -------------------+| |||| - // RA Steps/deg, normalized to 256MS (44-47) --------------------+ |||| + // DEC Steps/deg, normalized to 256MS (48-51) --------------------+| |||| + // RA Steps/deg, normalized to 256MS (44-47) ---------------------+ |||| // RA Homing Offet (40-43) -----------------------+||| // UTC Offset (39) ------------------------+|| // DEC lower (31-34) and upper (35-38) limits -------------------------+| @@ -137,6 +145,8 @@ class EEPROMStore LAST_FLASHED_MARKER_FLAG = 0x0080, AZ_POSITION_MARKER_FLAG = 0x0100, ALT_POSITION_MARKER_FLAG = 0x0200, + AZ_NORM_STEPS_MARKER_FLAG = 0x0400, + ALT_NORM_STEPS_MARKER_FLAG = 0x0800, }; // These are the offsets to each item stored in the EEPROM @@ -209,7 +219,15 @@ class EEPROMStore _ALT_POSITION_ADDR_1, _ALT_POSITION_ADDR_2, _ALT_POSITION_ADDR_3, - STORE_SIZE = 66 + AZ_NORM_STEPS_DEGREE_ADDR = 66, + _AZ_NORM_STEPS_DEGREE_ADDR_1, + _AZ_NORM_STEPS_DEGREE_ADDR_2, + _AZ_NORM_STEPS_DEGREE_ADDR_3, // Int32 + ALT_NORM_STEPS_DEGREE_ADDR = 70, + _ALT_NORM_STEPS_DEGREE_ADDR_1, + _ALT_NORM_STEPS_DEGREE_ADDR_2, + _ALT_NORM_STEPS_DEGREE_ADDR_3, // Int32 + STORE_SIZE = 74 }; // Helper functions diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index 7b5c848a..7bbe7eca 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -805,6 +805,24 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // Returns: // "float#" // +// :XGZ# +// Description: +// Get AZ steps +// Information: +// Get the number of steps the AZ stepper motor needs to take to rotate AZ by one degree +// Returns: +// "float#" if AZ motor is present +// "0#" if AZ is not configured +// +// :XGA# +// Description: +// Get ALT steps +// Information: +// Get the number of steps the ALT stepper motor needs to take to rotate ALT by one degree +// Returns: +// "float#" if ALT motor is present +// "0#" if ALT is not configured +// // :XGDLx# // Description: // Get DEC limits @@ -841,7 +859,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // "float#" // // :XGT# -// Description: +// Descrition: // Get Tracking speed // Information: // Get the absolute tracking speed of the mount. @@ -991,6 +1009,26 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // Returns: // nothing // +// :XSAn.n# +// Description: +// Set AZ steps +// Information: +// Set the number of steps the AZ stepper motor needs to take to rotate by one degree. +// Parameters: +// "n.n" is the number of steps (only one decimal point is supported, must be positive) +// Returns: +// nothing +// +// :XSLn.n# +// Description: +// Set ALT steps +// Information: +// Set the number of steps the ALT stepper motor needs to take to rotate by one degree. +// Parameters: +// "n.n" is the number of steps (only one decimal point is supported, must be positive) +// Returns: +// nothing +// // :XSDLUnnnnn# // Description: // Set DEC upper limit @@ -1818,6 +1856,14 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) { return String(_mount->getBacklashCorrection()) + "#"; } + else if ((inCmd[1] == 'A') && (inCmd.length() == 2)) // :XGA# + { + return String(_mount->getStepsPerDegree(ALTITUDE_STEPS),1) + "#"; + } + else if ((inCmd[1] == 'Z') && (inCmd.length() == 2)) // :XGZ# + { + return String(_mount->getStepsPerDegree(AZIMUTH_STEPS),1) + "#"; + } else if ((inCmd[1] == 'A') && (inCmd.length() > 2) && (inCmd[2] == 'H')) // :XGAH# { return _mount->getAutoHomingStates() + "#"; @@ -1911,6 +1957,14 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) { _mount->setStepsPerDegree(RA_STEPS, inCmd.substring(2).toFloat()); } + else if (inCmd[1] == 'A') // :XSA# + { + _mount->setStepsPerDegree(AZIMUTH_STEPS, inCmd.substring(2).toFloat()); + } + else if (inCmd[1] == 'L') // :XSL# + { + _mount->setStepsPerDegree(ALTITUDE_STEPS, inCmd.substring(2).toFloat()); + } else if (inCmd[1] == 'D') // :XSD { if ((inCmd.length() > 2) && (inCmd[2] == 'L')) // :XSDL diff --git a/src/Mount.cpp b/src/Mount.cpp index 2bb8d946..298656e9 100644 --- a/src/Mount.cpp +++ b/src/Mount.cpp @@ -190,6 +190,15 @@ void Mount::readPersistentData() _stepsPerDECDegree = EEPROMStore::getDECStepsPerDegree(); LOG(DEBUG_INFO, "[MOUNT]: EEPROM: DEC steps/deg is %f", _stepsPerDECDegree); + #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + _stepsPerAZDegree = EEPROMStore::getAZStepsPerDegree(); + LOG(DEBUG_INFO, "[MOUNT]: EEPROM: AZ steps/deg is %f", _stepsPerAZDegree); + #endif + + #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + _stepsPerALTDegree = EEPROMStore::getALTStepsPerDegree(); + LOG(DEBUG_INFO, "[MOUNT]: EEPROM: ALT steps/deg is %f", _stepsPerALTDegree); + #endif float speed = EEPROMStore::getSpeedFactor(); LOG(DEBUG_INFO, "[MOUNT]: EEPROM: Speed factor is %f", speed); setSpeedCalibration(speed, false); @@ -986,6 +995,22 @@ float Mount::getStepsPerDegree(StepperAxis which) { return _stepsPerDECDegree; // u-steps/degree } + if (which == AZIMUTH_STEPS) + { + #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + return _stepsPerAZDegree; // u-steps/degree + #else + return 1; + #endif + } + if (which == ALTITUDE_STEPS) + { + #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + return _stepsPerALTDegree; // u-steps/degree + #else + return 1; + #endif + } return 0; } @@ -1009,6 +1034,20 @@ void Mount::setStepsPerDegree(StepperAxis which, float steps) EEPROMStore::storeRAStepsPerDegree(_stepsPerRADegree); setSpeedCalibration(_trackingSpeedCalibration, false); } + #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + else if (which == AZIMUTH_STEPS) + { + _stepsPerAZDegree = steps; + EEPROMStore::storeAZStepsPerDegree(_stepsPerAZDegree); + } + #endif + #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + else if (which == ALTITUDE_STEPS) + { + _stepsPerALTDegree = steps; + EEPROMStore::storeALTStepsPerDegree(_stepsPerALTDegree); + } + #endif } ///////////////////////////////// @@ -2983,8 +3022,12 @@ void Mount::loop() // One of the motors was running last time through the loop, but not anymore, so shutdown the outputs. disableAzAltMotors(); _azAltWasRunning = false; - EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); - EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); + #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); + #endif + #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); + #endif } oneIsRunning = false; diff --git a/src/Mount.hpp b/src/Mount.hpp index fc897eec..1d170f9d 100644 --- a/src/Mount.hpp +++ b/src/Mount.hpp @@ -607,7 +607,7 @@ class Mount #else AccelStepper *_stepperAZ; #endif - const long _stepsPerAZDegree; // u-steps/degree (from CTOR) + float _stepsPerAZDegree; // u-steps/degree (from CTOR) #if AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART TMC2209Stepper *_driverAZ; #endif @@ -618,7 +618,7 @@ class Mount #else AccelStepper *_stepperALT; #endif - const long _stepsPerALTDegree; // u-steps/degree (from CTOR) + float _stepsPerALTDegree; // u-steps/degree (from CTOR) #if ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART TMC2209Stepper *_driverALT; #endif diff --git a/src/b_setup.hpp b/src/b_setup.hpp index 422d85ca..31eec150 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -437,6 +437,7 @@ void setup() LOG(DEBUG_ANY, "[STEPPERS]: AZ Stepper SPR : %d", AZ_STEPPER_SPR); LOG(DEBUG_ANY, "[STEPPERS]: AZ Circumference : %f", AZ_CIRCUMFERENCE); LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/rev : %f", AZIMUTH_STEPS_PER_REV); + LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/deg : %f", mount.getStepsPerDegree(AZIMUTH_STEPS)); LOG(DEBUG_ANY, "[STEPPERS]: AZ steps/minute : %f", AZIMUTH_STEPS_PER_ARC_MINUTE); mount.configureAZStepper(AZmotorPin1, AZmotorPin2, AZ_STEPPER_SPEED, AZ_STEPPER_ACCELERATION); #if AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART @@ -454,6 +455,7 @@ void setup() LOG(DEBUG_ANY, "[STEPPERS]: ALT Stepper SPR : %d", ALT_STEPPER_SPR); LOG(DEBUG_ANY, "[STEPPERS]: ALT Circumference : %f", ALT_CIRCUMFERENCE); LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/rev : %f", ALTITUDE_STEPS_PER_REV); + LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/deg : %f", mount.getStepsPerDegree(ALTITUDE_STEPS)); LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); mount.configureALTStepper(ALTmotorPin1, ALTmotorPin2, ALT_STEPPER_SPEED, ALT_STEPPER_ACCELERATION); #if ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART From 58a1f4039d6f82d82b870e8dc99889193f6b331d Mon Sep 17 00:00:00 2001 From: Fabian Uehleke Date: Wed, 6 Aug 2025 13:14:57 +0200 Subject: [PATCH 06/15] WIP - fix values and calculations for OAE ALT/AZ motion --- Configuration_adv.hpp | 21 ++++++++++----------- boards/ESP32_ESP32DEV/pins_OAE_V1.hpp | 1 - src/b_setup.hpp | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index e3abee7f..5ddfb83b 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -337,23 +337,25 @@ #ifdef OAE // Roughly from the joint to the rod placement is 70mm #define AZ_CIRCUMFERENCE 70.0f * 2 * PI + #ifndef AZ_ROD_PITCH + #define AZ_ROD_PITCH 0.5 + #endif + #define AZIMUTH_STEPS_PER_REV + \ + (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev #else #define AZ_CIRCUMFERENCE 2538.4f #endif #endif - #ifdef OAE - #ifndef AZ_WORMGEAR_RATIO - #define AZ_WORMGEAR_RATIO (40.0f) - #endif - #else + + #ifndef OAE #define AZ_WORMGEAR_RATIO 1.0f #endif #ifndef AZIMUTH_STEPS_PER_REV #define AZIMUTH_STEPS_PER_REV \ (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / (AZ_PULLEY_TEETH * GT2_BELT_PITCH)) * AZ_STEPPER_SPR \ - * AZ_MICROSTEPPING * AZ_WORMGEAR_RATIO) // Actually u-steps/rev + * AZ_MICROSTEPPING) // Actually u-steps/rev #endif #ifndef AZIMUTH_STEPS_PER_ARC_MINUTE @@ -420,12 +422,9 @@ #define ALT_ROD_PITCH 1.25 // mm/rev #endif // the Circumference of the ALT rotation. Roughly 146mm radius. - #define ALT_CIRCUMFERENCE 146.0f * 2 * PI - #ifndef ALT_WORMGEAR_RATIO - #define ALT_WORMGEAR_RATIO (40.0f) - #endif + #define ALT_CIRCUMFERENCE 128.0f * 2 * PI #define ALTITUDE_STEPS_PER_REV + \ - (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING * ALT_WORMGEAR_RATIO) // Actually u-steps/rev + (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev #else // the Circumference of the AZ rotation. 770mm dia. #define ALT_CIRCUMFERENCE 2419.0f diff --git a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp index 60d962f8..1bdb4b9f 100644 --- a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp +++ b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp @@ -105,7 +105,6 @@ // Defines for OAE /////////////////////// -#define OAM //enable GEM Motion #ifndef RA_WHEEL_CIRCUMFERENCE #define RA_WHEEL_CIRCUMFERENCE 704.97f diff --git a/src/b_setup.hpp b/src/b_setup.hpp index 31eec150..2d9e2696 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -180,7 +180,7 @@ void setup() #endif #ifdef RA_SERIAL_PORT - #if defined(BOARD_OAE_V1) + #ifdef OAE RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); #else RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver @@ -207,7 +207,7 @@ void setup() pinMode(DEC_DIAG_PIN, INPUT); #endif #ifdef DEC_SERIAL_PORT - #if defined(BOARD_OAE_V1) + #ifdef OAE DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); #else DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver From 99ff3ad26e0056f3f26ef1490eb9b50778d8acae Mon Sep 17 00:00:00 2001 From: Fabian Uehleke Date: Tue, 4 Nov 2025 14:28:27 +0100 Subject: [PATCH 07/15] adjust TMC driver current --- Configuration_adv.hpp | 4 ++-- src/Mount.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index 5ddfb83b..09ccb3e6 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -336,7 +336,7 @@ #ifndef AZ_CIRCUMFERENCE #ifdef OAE // Roughly from the joint to the rod placement is 70mm - #define AZ_CIRCUMFERENCE 70.0f * 2 * PI + #define AZ_CIRCUMFERENCE 56.0f * 2 * PI #ifndef AZ_ROD_PITCH #define AZ_ROD_PITCH 0.5 #endif @@ -422,7 +422,7 @@ #define ALT_ROD_PITCH 1.25 // mm/rev #endif // the Circumference of the ALT rotation. Roughly 146mm radius. - #define ALT_CIRCUMFERENCE 128.0f * 2 * PI + #define ALT_CIRCUMFERENCE 130.0f * 2 * PI #define ALTITUDE_STEPS_PER_REV + \ (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev #else diff --git a/src/Mount.cpp b/src/Mount.cpp index 298656e9..9ceca386 100644 --- a/src/Mount.cpp +++ b/src/Mount.cpp @@ -492,6 +492,8 @@ void Mount::configureRAdriver(Stream *serial, float rsense, byte driveraddress, #endif LOG(DEBUG_STEPPERS, "[MOUNT]: Requested RA motor rms_current: %d mA", rmscurrent); _driverRA->rms_current(rmscurrent, 1.0f); //holdMultiplier = 1 to set ihold = irun + _driverRA->pdn_disable(1); + _driverRA->ihold(31); _driverRA->toff(1); _driverRA->en_spreadCycle(RA_UART_STEALTH_MODE == 0); _driverRA->blank_time(24); @@ -575,6 +577,10 @@ void Mount::configureDECdriver(Stream *serial, float rsense, byte driveraddress, #endif LOG(DEBUG_STEPPERS, "[MOUNT]: Requested DEC motor rms_current: %d mA", rmscurrent); _driverDEC->rms_current(rmscurrent, 1.0f); //holdMultiplier = 1 to set ihold = irun + _driverDEC->pdn_disable(1); + _driverDEC->ihold(31); + _driverDEC->iholddelay(15); + _driverDEC->TPOWERDOWN(255); _driverDEC->toff(1); _driverDEC->en_spreadCycle(DEC_UART_STEALTH_MODE == 0); _driverDEC->blank_time(24); From 2bc86dfc229582ef3c64c7e43ee418bc35c1b92a Mon Sep 17 00:00:00 2001 From: Fabian Uehleke Date: Tue, 4 Nov 2025 14:30:08 +0100 Subject: [PATCH 08/15] Version bump --- Changelog.md | 3 +++ Version.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 2cda9f2a..e787e1e4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,6 @@ +**V1.13.17 - Updates** +- Final changes for OAE + **V1.13.17 - Updates** - Store AZ/ALT steps per degree and allow them to be set from Meade diff --git a/Version.h b/Version.h index 9c9e2e2b..3fa9e59d 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.17" +#define VERSION "V1.13.18" From c2a5f82cc721ecf8a829efa2bc96bc0e9a9a15b1 Mon Sep 17 00:00:00 2001 From: Fabian Uehleke Date: Tue, 4 Nov 2025 14:35:56 +0100 Subject: [PATCH 09/15] Version bump --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index e787e1e4..fbc44c3f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,4 @@ -**V1.13.17 - Updates** +**V1.13.18 - Updates** - Final changes for OAE **V1.13.17 - Updates** From 3ebf8c715176e3c5db918a23073edd0fb2804efb Mon Sep 17 00:00:00 2001 From: Fabian Uehleke Date: Tue, 4 Nov 2025 15:14:05 +0100 Subject: [PATCH 10/15] apply clang-format --- ConfigurationValidation.hpp | 5 +- Configuration_adv.hpp | 21 +- Constants.hpp | 2 +- boards/ESP32_ESP32DEV/pins_OAE_V1.hpp | 9 +- clang-format-diff.patch | 448 ++++++++++++++++++++++++++ src/EPROMStore.cpp | 14 +- src/MeadeCommandProcessor.cpp | 4 +- src/Mount.cpp | 60 ++-- src/Mount.hpp | 2 +- src/b_setup.hpp | 12 +- src/testmenu.cpp | 10 +- 11 files changed, 514 insertions(+), 73 deletions(-) create mode 100644 clang-format-diff.patch diff --git a/ConfigurationValidation.hpp b/ConfigurationValidation.hpp index 74667a10..82ed67ed 100644 --- a/ConfigurationValidation.hpp +++ b/ConfigurationValidation.hpp @@ -90,8 +90,7 @@ #endif #endif #elif defined(BOARD_OAE_V1) - // Valid - +// Valid #else #error Configuration does not support AZ. Use at own risk. @@ -114,7 +113,7 @@ #endif #elif defined(BOARD_OAE_V1) - // Valid +// Valid #else #warning Configuration does not support ALT. Use at own risk. diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index 09ccb3e6..cd168333 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -340,13 +340,12 @@ #ifndef AZ_ROD_PITCH #define AZ_ROD_PITCH 0.5 #endif - #define AZIMUTH_STEPS_PER_REV + \ - (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev + #define AZIMUTH_STEPS_PER_REV \ + +(AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev #else #define AZ_CIRCUMFERENCE 2538.4f #endif #endif - #ifndef OAE #define AZ_WORMGEAR_RATIO 1.0f @@ -357,7 +356,7 @@ (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / (AZ_PULLEY_TEETH * GT2_BELT_PITCH)) * AZ_STEPPER_SPR \ * AZ_MICROSTEPPING) // Actually u-steps/rev #endif - + #ifndef AZIMUTH_STEPS_PER_ARC_MINUTE #define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps #endif @@ -416,15 +415,16 @@ #define ALTITUDE_STEPS_PER_REV \ (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev - #else + #else #ifdef OAE #ifndef ALT_ROD_PITCH #define ALT_ROD_PITCH 1.25 // mm/rev #endif // the Circumference of the ALT rotation. Roughly 146mm radius. #define ALT_CIRCUMFERENCE 130.0f * 2 * PI - #define ALTITUDE_STEPS_PER_REV + \ - (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev + #define ALTITUDE_STEPS_PER_REV \ + +(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR \ + * ALT_MICROSTEPPING) // Actually u-steps/rev #else // the Circumference of the AZ rotation. 770mm dia. #define ALT_CIRCUMFERENCE 2419.0f @@ -436,9 +436,9 @@ #define ALT_WORMGEAR_RATIO (40.0f) #endif #ifndef ALTITUDE_STEPS_PER_REV - #define ALTITUDE_STEPS_PER_REV \ - (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \ - * ALT_WORMGEAR_RATIO) // Actually u-steps/rev + #define ALTITUDE_STEPS_PER_REV \ + (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR \ + * ALT_MICROSTEPPING * ALT_WORMGEAR_RATIO) // Actually u-steps/rev #endif #endif #endif @@ -649,7 +649,6 @@ // //////// //////////////////////////////////////////// - // Focuser #if (FOCUS_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) #if defined(ESP32) diff --git a/Constants.hpp b/Constants.hpp index 17c00429..f4a9ddd0 100644 --- a/Constants.hpp +++ b/Constants.hpp @@ -18,7 +18,7 @@ // ESP32 based boards #define BOARD_ESP32_ESP32DEV 1001 -#define BOARD_OAE_V1 1002 +#define BOARD_OAE_V1 1002 /** * Supported keypad/display types. Use one of these values for DISPLAY_TYPE configuration matching your used display and keypad. diff --git a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp index 1bdb4b9f..00d3db68 100644 --- a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp +++ b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp @@ -83,13 +83,13 @@ // DISPLAY_TYPE_LCD_JOY_I2C_SSD1306 requires 3 analog inputs in Arduino pin numbering #ifndef LCD_KEY_SENSE_X_PIN - //#define LCD_KEY_SENSE_X_PIN 34 +//#define LCD_KEY_SENSE_X_PIN 34 #endif #ifndef LCD_KEY_SENSE_Y_PIN - //#define LCD_KEY_SENSE_Y_PIN 39 +//#define LCD_KEY_SENSE_Y_PIN 39 #endif #ifndef LCD_KEY_SENSE_PUSH_PIN - //#define LCD_KEY_SENSE_PUSH_PIN 36 +//#define LCD_KEY_SENSE_PUSH_PIN 36 #endif //Serial port for external debugging @@ -103,7 +103,6 @@ #endif #endif - // Defines for OAE /////////////////////// #ifndef RA_WHEEL_CIRCUMFERENCE @@ -125,7 +124,7 @@ #define DEC_WHEEL_CIRCUMFERENCE 1.0f #endif #ifndef RA_STEPPER_SPR - #define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper + #define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper #endif #ifndef DEC_STEPPER_SPR #define DEC_STEPPER_SPR (200 * 50 * 4.5f) // change to (200 * 9) for 1.8° stepper diff --git a/clang-format-diff.patch b/clang-format-diff.patch new file mode 100644 index 00000000..b71ab8e0 --- /dev/null +++ b/clang-format-diff.patch @@ -0,0 +1,448 @@ +diff --git a/ConfigurationValidation.hpp b/ConfigurationValidation.hpp +index 74667a1..82ed67e 100644 +--- a/ConfigurationValidation.hpp ++++ b/ConfigurationValidation.hpp +@@ -90,8 +90,7 @@ + #endif + #endif + #elif defined(BOARD_OAE_V1) +- // Valid +- ++// Valid + + #else + #error Configuration does not support AZ. Use at own risk. +@@ -114,7 +113,7 @@ + #endif + + #elif defined(BOARD_OAE_V1) +- // Valid ++// Valid + + #else + #warning Configuration does not support ALT. Use at own risk. +diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp +index 09ccb3e..cd16833 100644 +--- a/Configuration_adv.hpp ++++ b/Configuration_adv.hpp +@@ -340,13 +340,12 @@ + #ifndef AZ_ROD_PITCH + #define AZ_ROD_PITCH 0.5 + #endif +- #define AZIMUTH_STEPS_PER_REV + \ +- (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev ++ #define AZIMUTH_STEPS_PER_REV \ ++ +(AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev + #else + #define AZ_CIRCUMFERENCE 2538.4f + #endif + #endif +- + + #ifndef OAE + #define AZ_WORMGEAR_RATIO 1.0f +@@ -357,7 +356,7 @@ + (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / (AZ_PULLEY_TEETH * GT2_BELT_PITCH)) * AZ_STEPPER_SPR \ + * AZ_MICROSTEPPING) // Actually u-steps/rev + #endif +- ++ + #ifndef AZIMUTH_STEPS_PER_ARC_MINUTE + #define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps + #endif +@@ -416,15 +415,16 @@ + #define ALTITUDE_STEPS_PER_REV \ + (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev + +- #else ++ #else + #ifdef OAE + #ifndef ALT_ROD_PITCH + #define ALT_ROD_PITCH 1.25 // mm/rev + #endif + // the Circumference of the ALT rotation. Roughly 146mm radius. + #define ALT_CIRCUMFERENCE 130.0f * 2 * PI +- #define ALTITUDE_STEPS_PER_REV + \ +- (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev ++ #define ALTITUDE_STEPS_PER_REV \ ++ +(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR \ ++ * ALT_MICROSTEPPING) // Actually u-steps/rev + #else + // the Circumference of the AZ rotation. 770mm dia. + #define ALT_CIRCUMFERENCE 2419.0f +@@ -436,9 +436,9 @@ + #define ALT_WORMGEAR_RATIO (40.0f) + #endif + #ifndef ALTITUDE_STEPS_PER_REV +- #define ALTITUDE_STEPS_PER_REV \ +- (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \ +- * ALT_WORMGEAR_RATIO) // Actually u-steps/rev ++ #define ALTITUDE_STEPS_PER_REV \ ++ (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR \ ++ * ALT_MICROSTEPPING * ALT_WORMGEAR_RATIO) // Actually u-steps/rev + #endif + #endif + #endif +@@ -649,7 +649,6 @@ + // //////// + //////////////////////////////////////////// + +- + // Focuser + #if (FOCUS_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) + #if defined(ESP32) +diff --git a/Constants.hpp b/Constants.hpp +index 17c0042..f4a9ddd 100644 +--- a/Constants.hpp ++++ b/Constants.hpp +@@ -18,7 +18,7 @@ + + // ESP32 based boards + #define BOARD_ESP32_ESP32DEV 1001 +-#define BOARD_OAE_V1 1002 ++#define BOARD_OAE_V1 1002 + + /** + * Supported keypad/display types. Use one of these values for DISPLAY_TYPE configuration matching your used display and keypad. +diff --git a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp +index 1bdb4b9..00d3db6 100644 +--- a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp ++++ b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp +@@ -83,13 +83,13 @@ + + // DISPLAY_TYPE_LCD_JOY_I2C_SSD1306 requires 3 analog inputs in Arduino pin numbering + #ifndef LCD_KEY_SENSE_X_PIN +- //#define LCD_KEY_SENSE_X_PIN 34 ++//#define LCD_KEY_SENSE_X_PIN 34 + #endif + #ifndef LCD_KEY_SENSE_Y_PIN +- //#define LCD_KEY_SENSE_Y_PIN 39 ++//#define LCD_KEY_SENSE_Y_PIN 39 + #endif + #ifndef LCD_KEY_SENSE_PUSH_PIN +- //#define LCD_KEY_SENSE_PUSH_PIN 36 ++//#define LCD_KEY_SENSE_PUSH_PIN 36 + #endif + + //Serial port for external debugging +@@ -103,7 +103,6 @@ + #endif + #endif + +- + // Defines for OAE /////////////////////// + + #ifndef RA_WHEEL_CIRCUMFERENCE +@@ -125,7 +124,7 @@ + #define DEC_WHEEL_CIRCUMFERENCE 1.0f + #endif + #ifndef RA_STEPPER_SPR +- #define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper ++ #define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper + #endif + #ifndef DEC_STEPPER_SPR + #define DEC_STEPPER_SPR (200 * 50 * 4.5f) // change to (200 * 9) for 1.8° stepper +diff --git a/src/EPROMStore.cpp b/src/EPROMStore.cpp +index bb20c8e..b82d7be 100644 +--- a/src/EPROMStore.cpp ++++ b/src/EPROMStore.cpp +@@ -469,11 +469,11 @@ void EEPROMStore::storeDECStepsPerDegree(float decStepsPerDegree) + // If it is not present then the default uncalibrated AZ_STEPS_PER_DEGREE value is returned. + float EEPROMStore::getAZStepsPerDegree() + { +- #if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE ++#if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE + float azStepsPerDegree(AZIMUTH_STEPS_PER_REV / 360); // Default value +- #else ++#else + float azStepsPerDegree(1); // Default value +- #endif ++#endif + + if (isPresentExtended(AZ_NORM_STEPS_MARKER_FLAG)) + { +@@ -503,16 +503,15 @@ void EEPROMStore::storeAZStepsPerDegree(float azStepsPerDegree) + commit(); // Complete the transaction + } + +- + // Return the ALT steps per degree (actually microsteps per degree). + // If it is not present then the default uncalibrated ALT_STEPS_PER_DEGREE value is returned. + float EEPROMStore::getALTStepsPerDegree() + { +- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) ++#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + float azStepsPerDegree(ALTITUDE_STEPS_PER_REV / 360); // Default value +- #else ++#else + float azStepsPerDegree(1); // Default value +- #endif ++#endif + + if (isPresentExtended(ALT_NORM_STEPS_MARKER_FLAG)) + { +@@ -542,7 +541,6 @@ void EEPROMStore::storeALTStepsPerDegree(float azStepsPerDegree) + commit(); // Complete the transaction + } + +- + int16_t EEPROMStore::getLastFlashedVersion() + { + if (isPresentExtended(LAST_FLASHED_MARKER_FLAG)) +diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp +index 7bbe7ec..0788954 100644 +--- a/src/MeadeCommandProcessor.cpp ++++ b/src/MeadeCommandProcessor.cpp +@@ -1858,11 +1858,11 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) + } + else if ((inCmd[1] == 'A') && (inCmd.length() == 2)) // :XGA# + { +- return String(_mount->getStepsPerDegree(ALTITUDE_STEPS),1) + "#"; ++ return String(_mount->getStepsPerDegree(ALTITUDE_STEPS), 1) + "#"; + } + else if ((inCmd[1] == 'Z') && (inCmd.length() == 2)) // :XGZ# + { +- return String(_mount->getStepsPerDegree(AZIMUTH_STEPS),1) + "#"; ++ return String(_mount->getStepsPerDegree(AZIMUTH_STEPS), 1) + "#"; + } + else if ((inCmd[1] == 'A') && (inCmd.length() > 2) && (inCmd[2] == 'H')) // :XGAH# + { +diff --git a/src/Mount.cpp b/src/Mount.cpp +index 9ceca38..bd2a94b 100644 +--- a/src/Mount.cpp ++++ b/src/Mount.cpp +@@ -78,7 +78,7 @@ Mount::Mount(LcdMenu *lcdMenu) + + { + _commandReceived = 0; +- _lcdMenu = lcdMenu; ++ _lcdMenu = lcdMenu; + initializeVariables(); + } + +@@ -190,15 +190,15 @@ void Mount::readPersistentData() + _stepsPerDECDegree = EEPROMStore::getDECStepsPerDegree(); + LOG(DEBUG_INFO, "[MOUNT]: EEPROM: DEC steps/deg is %f", _stepsPerDECDegree); + +- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) ++#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + _stepsPerAZDegree = EEPROMStore::getAZStepsPerDegree(); + LOG(DEBUG_INFO, "[MOUNT]: EEPROM: AZ steps/deg is %f", _stepsPerAZDegree); +- #endif ++#endif + +- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) ++#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + _stepsPerALTDegree = EEPROMStore::getALTStepsPerDegree(); + LOG(DEBUG_INFO, "[MOUNT]: EEPROM: ALT steps/deg is %f", _stepsPerALTDegree); +- #endif ++#endif + float speed = EEPROMStore::getSpeedFactor(); + LOG(DEBUG_INFO, "[MOUNT]: EEPROM: Speed factor is %f", speed); + setSpeedCalibration(speed, false); +@@ -1003,19 +1003,19 @@ float Mount::getStepsPerDegree(StepperAxis which) + } + if (which == AZIMUTH_STEPS) + { +- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) ++#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + return _stepsPerAZDegree; // u-steps/degree +- #else ++#else + return 1; +- #endif ++#endif + } + if (which == ALTITUDE_STEPS) + { +- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) ++#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + return _stepsPerALTDegree; // u-steps/degree +- #else ++#else + return 1; +- #endif ++#endif + } + + return 0; +@@ -1040,20 +1040,20 @@ void Mount::setStepsPerDegree(StepperAxis which, float steps) + EEPROMStore::storeRAStepsPerDegree(_stepsPerRADegree); + setSpeedCalibration(_trackingSpeedCalibration, false); + } +- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) ++#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + else if (which == AZIMUTH_STEPS) + { + _stepsPerAZDegree = steps; + EEPROMStore::storeAZStepsPerDegree(_stepsPerAZDegree); + } +- #endif +- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) ++#endif ++#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + else if (which == ALTITUDE_STEPS) + { + _stepsPerALTDegree = steps; + EEPROMStore::storeALTStepsPerDegree(_stepsPerALTDegree); + } +- #endif ++#endif + } + + ///////////////////////////////// +@@ -1621,13 +1621,13 @@ void Mount::stopGuiding(bool ra, bool dec) + // Stop DEC guiding and wait for it to stop. + _stepperGUIDE->stop(); + +- #if !defined(ESP32BOARD) ++#if !defined(ESP32BOARD) + while (_stepperGUIDE->isRunning()) + { + _stepperGUIDE->run(); + _stepperTRK->runSpeed(); + } +- #endif ++#endif + + _mountStatus &= ~STATUS_GUIDE_PULSE_DEC; + } +@@ -2678,9 +2678,7 @@ void Mount::waitUntilStopped(byte direction) + // Block until all steppers are stopped + void Mount::waitUntilAllStopped() + { +- while (_stepperRA->isRunning() +- || _stepperDEC->isRunning() +- || (((_mountStatus & STATUS_TRACKING) == 0) && _stepperTRK->isRunning()) ++ while (_stepperRA->isRunning() || _stepperDEC->isRunning() || (((_mountStatus & STATUS_TRACKING) == 0) && _stepperTRK->isRunning()) + #if FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE + || _stepperFocus->isRunning() + #endif +@@ -3028,12 +3026,12 @@ void Mount::loop() + // One of the motors was running last time through the loop, but not anymore, so shutdown the outputs. + disableAzAltMotors(); + _azAltWasRunning = false; +- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) +- EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); +- #endif +- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) +- EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); +- #endif ++ #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) ++ EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); ++ #endif ++ #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) ++ EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); ++ #endif + } + + oneIsRunning = false; +@@ -3305,16 +3303,16 @@ void Mount::updateInfoDisplay() + { + #if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE) + // If we update this display too often while slewing, the serial port is unable to process commands fast enough. Which makes the driver +- // timeout, causing ASCOM errors. ++ // timeout, causing ASCOM errors. + // We will update at 30Hz when idle, 5Hz when slewing one axis and skip updates when slewing both. + int refreshRateHz = 30; +- long now = millis(); +- if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA)) ++ long now = millis(); ++ if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA)) + { + return; + } +- +- if (isSlewingRAorDEC()) ++ ++ if (isSlewingRAorDEC()) + { + refreshRateHz = 5; + } +diff --git a/src/Mount.hpp b/src/Mount.hpp +index 1d170f9..7cf00a7 100644 +--- a/src/Mount.hpp ++++ b/src/Mount.hpp +@@ -406,7 +406,7 @@ class Mount + void setupInfoDisplay(); + void updateInfoDisplay(); + InfoDisplayRender *getInfoDisplay(); +- long _lastInfoUpdate = 0; // Last time the info display was updated ++ long _lastInfoUpdate = 0; // Last time the info display was updated + #endif + + // Called by Meade processor every time a command is received. +diff --git a/src/b_setup.hpp b/src/b_setup.hpp +index 2d9e269..5ac294a 100644 +--- a/src/b_setup.hpp ++++ b/src/b_setup.hpp +@@ -181,9 +181,9 @@ void setup() + + #ifdef RA_SERIAL_PORT + #ifdef OAE +- RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); ++ RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); + #else +- RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver ++ RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + #endif + // + #endif +@@ -204,13 +204,13 @@ void setup() + #if DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART + // include TMC2209 UART pins + #if defined(DEC_DIAG_PIN) +- pinMode(DEC_DIAG_PIN, INPUT); ++ pinMode(DEC_DIAG_PIN, INPUT); + #endif + #ifdef DEC_SERIAL_PORT + #ifdef OAE +- DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); ++ DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); + #else +- DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver ++ DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + #endif + #endif + #endif +@@ -456,7 +456,7 @@ void setup() + LOG(DEBUG_ANY, "[STEPPERS]: ALT Circumference : %f", ALT_CIRCUMFERENCE); + LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/rev : %f", ALTITUDE_STEPS_PER_REV); + LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/deg : %f", mount.getStepsPerDegree(ALTITUDE_STEPS)); +- LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); ++ LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); + mount.configureALTStepper(ALTmotorPin1, ALTmotorPin2, ALT_STEPPER_SPEED, ALT_STEPPER_ACCELERATION); + #if ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART + LOG(DEBUG_ANY, "[STEPPERS]: Configure ALT driver..."); +diff --git a/src/testmenu.cpp b/src/testmenu.cpp +index 0dcabb5..b046bf4 100644 +--- a/src/testmenu.cpp ++++ b/src/testmenu.cpp +@@ -261,12 +261,12 @@ void TestMenu::listHardware() const + int index = 0; + Serial.print(F(" Mount: ")); + #ifdef OAM +- Serial.println(F("OpenAstroMount (OAM)")); ++ Serial.println(F("OpenAstroMount (OAM)")); + #else + #ifdef OAE +- Serial.println(F("OpenAstroExplorer (OAE)")); ++ Serial.println(F("OpenAstroExplorer (OAE)")); + #else +- Serial.println(F("OpenAstroTracker (OAT)")); ++ Serial.println(F("OpenAstroTracker (OAT)")); + #endif + #endif + +@@ -534,9 +534,9 @@ void TestMenu::display() const + Serial.println(F("*** OpenAstroMount (OAM) Test Menu ***")); + #else + #ifdef OAE +- Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); ++ Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); + #else +- Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); ++ Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); + #endif + #endif + Serial.print(F("************* ")); diff --git a/src/EPROMStore.cpp b/src/EPROMStore.cpp index bb20c8e0..b82d7be8 100644 --- a/src/EPROMStore.cpp +++ b/src/EPROMStore.cpp @@ -469,11 +469,11 @@ void EEPROMStore::storeDECStepsPerDegree(float decStepsPerDegree) // If it is not present then the default uncalibrated AZ_STEPS_PER_DEGREE value is returned. float EEPROMStore::getAZStepsPerDegree() { - #if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE +#if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE float azStepsPerDegree(AZIMUTH_STEPS_PER_REV / 360); // Default value - #else +#else float azStepsPerDegree(1); // Default value - #endif +#endif if (isPresentExtended(AZ_NORM_STEPS_MARKER_FLAG)) { @@ -503,16 +503,15 @@ void EEPROMStore::storeAZStepsPerDegree(float azStepsPerDegree) commit(); // Complete the transaction } - // Return the ALT steps per degree (actually microsteps per degree). // If it is not present then the default uncalibrated ALT_STEPS_PER_DEGREE value is returned. float EEPROMStore::getALTStepsPerDegree() { - #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) +#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) float azStepsPerDegree(ALTITUDE_STEPS_PER_REV / 360); // Default value - #else +#else float azStepsPerDegree(1); // Default value - #endif +#endif if (isPresentExtended(ALT_NORM_STEPS_MARKER_FLAG)) { @@ -542,7 +541,6 @@ void EEPROMStore::storeALTStepsPerDegree(float azStepsPerDegree) commit(); // Complete the transaction } - int16_t EEPROMStore::getLastFlashedVersion() { if (isPresentExtended(LAST_FLASHED_MARKER_FLAG)) diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index 7bbe7eca..07889548 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -1858,11 +1858,11 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) } else if ((inCmd[1] == 'A') && (inCmd.length() == 2)) // :XGA# { - return String(_mount->getStepsPerDegree(ALTITUDE_STEPS),1) + "#"; + return String(_mount->getStepsPerDegree(ALTITUDE_STEPS), 1) + "#"; } else if ((inCmd[1] == 'Z') && (inCmd.length() == 2)) // :XGZ# { - return String(_mount->getStepsPerDegree(AZIMUTH_STEPS),1) + "#"; + return String(_mount->getStepsPerDegree(AZIMUTH_STEPS), 1) + "#"; } else if ((inCmd[1] == 'A') && (inCmd.length() > 2) && (inCmd[2] == 'H')) // :XGAH# { diff --git a/src/Mount.cpp b/src/Mount.cpp index 9ceca386..bd2a94b4 100644 --- a/src/Mount.cpp +++ b/src/Mount.cpp @@ -78,7 +78,7 @@ Mount::Mount(LcdMenu *lcdMenu) { _commandReceived = 0; - _lcdMenu = lcdMenu; + _lcdMenu = lcdMenu; initializeVariables(); } @@ -190,15 +190,15 @@ void Mount::readPersistentData() _stepsPerDECDegree = EEPROMStore::getDECStepsPerDegree(); LOG(DEBUG_INFO, "[MOUNT]: EEPROM: DEC steps/deg is %f", _stepsPerDECDegree); - #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) +#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) _stepsPerAZDegree = EEPROMStore::getAZStepsPerDegree(); LOG(DEBUG_INFO, "[MOUNT]: EEPROM: AZ steps/deg is %f", _stepsPerAZDegree); - #endif +#endif - #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) +#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) _stepsPerALTDegree = EEPROMStore::getALTStepsPerDegree(); LOG(DEBUG_INFO, "[MOUNT]: EEPROM: ALT steps/deg is %f", _stepsPerALTDegree); - #endif +#endif float speed = EEPROMStore::getSpeedFactor(); LOG(DEBUG_INFO, "[MOUNT]: EEPROM: Speed factor is %f", speed); setSpeedCalibration(speed, false); @@ -1003,19 +1003,19 @@ float Mount::getStepsPerDegree(StepperAxis which) } if (which == AZIMUTH_STEPS) { - #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) +#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) return _stepsPerAZDegree; // u-steps/degree - #else +#else return 1; - #endif +#endif } if (which == ALTITUDE_STEPS) { - #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) +#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) return _stepsPerALTDegree; // u-steps/degree - #else +#else return 1; - #endif +#endif } return 0; @@ -1040,20 +1040,20 @@ void Mount::setStepsPerDegree(StepperAxis which, float steps) EEPROMStore::storeRAStepsPerDegree(_stepsPerRADegree); setSpeedCalibration(_trackingSpeedCalibration, false); } - #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) +#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) else if (which == AZIMUTH_STEPS) { _stepsPerAZDegree = steps; EEPROMStore::storeAZStepsPerDegree(_stepsPerAZDegree); } - #endif - #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) +#endif +#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) else if (which == ALTITUDE_STEPS) { _stepsPerALTDegree = steps; EEPROMStore::storeALTStepsPerDegree(_stepsPerALTDegree); } - #endif +#endif } ///////////////////////////////// @@ -1621,13 +1621,13 @@ void Mount::stopGuiding(bool ra, bool dec) // Stop DEC guiding and wait for it to stop. _stepperGUIDE->stop(); - #if !defined(ESP32BOARD) +#if !defined(ESP32BOARD) while (_stepperGUIDE->isRunning()) { _stepperGUIDE->run(); _stepperTRK->runSpeed(); } - #endif +#endif _mountStatus &= ~STATUS_GUIDE_PULSE_DEC; } @@ -2678,9 +2678,7 @@ void Mount::waitUntilStopped(byte direction) // Block until all steppers are stopped void Mount::waitUntilAllStopped() { - while (_stepperRA->isRunning() - || _stepperDEC->isRunning() - || (((_mountStatus & STATUS_TRACKING) == 0) && _stepperTRK->isRunning()) + while (_stepperRA->isRunning() || _stepperDEC->isRunning() || (((_mountStatus & STATUS_TRACKING) == 0) && _stepperTRK->isRunning()) #if FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE || _stepperFocus->isRunning() #endif @@ -3028,12 +3026,12 @@ void Mount::loop() // One of the motors was running last time through the loop, but not anymore, so shutdown the outputs. disableAzAltMotors(); _azAltWasRunning = false; - #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) - EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); - #endif - #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) - EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); - #endif + #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) + EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); + #endif + #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) + EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); + #endif } oneIsRunning = false; @@ -3305,16 +3303,16 @@ void Mount::updateInfoDisplay() { #if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE) // If we update this display too often while slewing, the serial port is unable to process commands fast enough. Which makes the driver - // timeout, causing ASCOM errors. + // timeout, causing ASCOM errors. // We will update at 30Hz when idle, 5Hz when slewing one axis and skip updates when slewing both. int refreshRateHz = 30; - long now = millis(); - if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA)) + long now = millis(); + if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA)) { return; } - - if (isSlewingRAorDEC()) + + if (isSlewingRAorDEC()) { refreshRateHz = 5; } diff --git a/src/Mount.hpp b/src/Mount.hpp index 1d170f9d..7cf00a73 100644 --- a/src/Mount.hpp +++ b/src/Mount.hpp @@ -406,7 +406,7 @@ class Mount void setupInfoDisplay(); void updateInfoDisplay(); InfoDisplayRender *getInfoDisplay(); - long _lastInfoUpdate = 0; // Last time the info display was updated + long _lastInfoUpdate = 0; // Last time the info display was updated #endif // Called by Meade processor every time a command is received. diff --git a/src/b_setup.hpp b/src/b_setup.hpp index 2d9e2696..5ac294a5 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -181,9 +181,9 @@ void setup() #ifdef RA_SERIAL_PORT #ifdef OAE - RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); + RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); #else - RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver #endif // #endif @@ -204,13 +204,13 @@ void setup() #if DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART // include TMC2209 UART pins #if defined(DEC_DIAG_PIN) - pinMode(DEC_DIAG_PIN, INPUT); + pinMode(DEC_DIAG_PIN, INPUT); #endif #ifdef DEC_SERIAL_PORT #ifdef OAE - DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); + DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); #else - DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver + DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver #endif #endif #endif @@ -456,7 +456,7 @@ void setup() LOG(DEBUG_ANY, "[STEPPERS]: ALT Circumference : %f", ALT_CIRCUMFERENCE); LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/rev : %f", ALTITUDE_STEPS_PER_REV); LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/deg : %f", mount.getStepsPerDegree(ALTITUDE_STEPS)); - LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); + LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); mount.configureALTStepper(ALTmotorPin1, ALTmotorPin2, ALT_STEPPER_SPEED, ALT_STEPPER_ACCELERATION); #if ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART LOG(DEBUG_ANY, "[STEPPERS]: Configure ALT driver..."); diff --git a/src/testmenu.cpp b/src/testmenu.cpp index 0dcabb51..b046bf42 100644 --- a/src/testmenu.cpp +++ b/src/testmenu.cpp @@ -261,12 +261,12 @@ void TestMenu::listHardware() const int index = 0; Serial.print(F(" Mount: ")); #ifdef OAM - Serial.println(F("OpenAstroMount (OAM)")); + Serial.println(F("OpenAstroMount (OAM)")); #else #ifdef OAE - Serial.println(F("OpenAstroExplorer (OAE)")); + Serial.println(F("OpenAstroExplorer (OAE)")); #else - Serial.println(F("OpenAstroTracker (OAT)")); + Serial.println(F("OpenAstroTracker (OAT)")); #endif #endif @@ -534,9 +534,9 @@ void TestMenu::display() const Serial.println(F("*** OpenAstroMount (OAM) Test Menu ***")); #else #ifdef OAE - Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); + Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); #else - Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); + Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); #endif #endif Serial.print(F("************* ")); From cc688968925c10f5d263f1dcc6b00bcd033c8255 Mon Sep 17 00:00:00 2001 From: Lutz Date: Tue, 4 Nov 2025 20:23:57 -0800 Subject: [PATCH 11/15] Merged origin --- Configuration_adv.hpp | 9 +++++++++ LocalConfiguration.hpp | 2 ++ src/MeadeCommandProcessor.cpp | 2 ++ src/b_setup.hpp | 2 ++ 4 files changed, 15 insertions(+) diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp index cd168333..bec77a73 100644 --- a/Configuration_adv.hpp +++ b/Configuration_adv.hpp @@ -22,6 +22,15 @@ #define BUFFER_LOGS false #endif +#ifndef OAM + #ifndef OAE + #define OAT "OAT" + #endif +#endif +#if defined(OAE) && defined(OAM) + #error "OAE and OAM cannot be defined at the same time" +#endif + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // //////// // MOTOR & DRIVER SETTINGS //////// diff --git a/LocalConfiguration.hpp b/LocalConfiguration.hpp index 0c816418..14a00510 100644 --- a/LocalConfiguration.hpp +++ b/LocalConfiguration.hpp @@ -16,6 +16,8 @@ #include "Configuration_local_mksgenlv1.hpp" #elif BOARD == BOARD_ESP32_ESP32DEV && __has_include("Configuration_local_esp32dev.hpp") #include "Configuration_local_esp32dev.hpp" +#elif BOARD == BOARD_OAE_V1 && __has_include("Configuration_local_oae.hpp") + #include "Configuration_local_oae.hpp" #elif __has_include("Configuration_local.hpp") #include "Configuration_local.hpp" #endif \ No newline at end of file diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index 07889548..370ea4b3 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -1273,6 +1273,8 @@ String MeadeCommandProcessor::handleMeadeGetInfo(String inCmd) { #ifdef OAM return "OpenAstroMount#"; +#elif defined(OAE) + return "OpenAstroExplorer#"; #else return "OpenAstroTracker#"; #endif diff --git a/src/b_setup.hpp b/src/b_setup.hpp index 5ac294a5..e8cb3534 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -282,6 +282,8 @@ void setup() lcdMenu.setCursor(0, 0); #ifdef OAM lcdMenu.printMenu(" OpenAstroMount"); + #elif defined(OAE) + lcdMenu.printMenu(" OpenAstroExplorer"); #else lcdMenu.printMenu("OpenAstroTracker"); #endif From 3f5c2b2b0a45c6c52f6323ff330342b00b597e5a Mon Sep 17 00:00:00 2001 From: Andre Stefanov Date: Sat, 8 Nov 2025 00:02:23 +0100 Subject: [PATCH 12/15] Enhance EEPROM handling by adding checks for disabled stepper axes in AZ and ALT steps storage and retrieval --- .gitignore | 2 ++ src/EPROMStore.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index 552d3173..c32dd46c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ .pio .vscode venv +.venv +__pycache__ .idea cmake-* CMakeLists.txt diff --git a/src/EPROMStore.cpp b/src/EPROMStore.cpp index b82d7be8..5784c177 100644 --- a/src/EPROMStore.cpp +++ b/src/EPROMStore.cpp @@ -477,10 +477,14 @@ float EEPROMStore::getAZStepsPerDegree() if (isPresentExtended(AZ_NORM_STEPS_MARKER_FLAG)) { +#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) // Latest version stores 100x steps/deg for 256 MS const float factor = SteppingStorageNormalized / AZ_MICROSTEPPING; azStepsPerDegree = readInt32(AZ_NORM_STEPS_DEGREE_ADDR) / factor; LOG(DEBUG_EEPROM, "[EEPROM]: AZ Normed Marker Present! AZ steps/deg is %f", azStepsPerDegree); +#else + LOG(DEBUG_EEPROM, "[EEPROM]: AZ marker present but AZ axis disabled; ignoring stored value"); +#endif } else { @@ -494,6 +498,7 @@ float EEPROMStore::getAZStepsPerDegree() void EEPROMStore::storeAZStepsPerDegree(float azStepsPerDegree) { // Store steps as 100x steps/deg at 256 MS. +#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) const float factor = SteppingStorageNormalized / AZ_MICROSTEPPING; int32_t val = azStepsPerDegree * factor; LOG(DEBUG_EEPROM, "[EEPROM]: Storing AZ steps to %l (%f)", val, azStepsPerDegree); @@ -501,6 +506,10 @@ void EEPROMStore::storeAZStepsPerDegree(float azStepsPerDegree) updateInt32(AZ_NORM_STEPS_DEGREE_ADDR, val); updateFlagsExtended(AZ_NORM_STEPS_MARKER_FLAG); commit(); // Complete the transaction +#else + LOG(DEBUG_EEPROM, "[EEPROM]: Skipping AZ steps store; AZ axis disabled"); + (void) azStepsPerDegree; +#endif } // Return the ALT steps per degree (actually microsteps per degree). @@ -515,10 +524,14 @@ float EEPROMStore::getALTStepsPerDegree() if (isPresentExtended(ALT_NORM_STEPS_MARKER_FLAG)) { +#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) // Latest version stores 100x steps/deg for 256 MS const float factor = SteppingStorageNormalized / ALT_MICROSTEPPING; azStepsPerDegree = readInt32(ALT_NORM_STEPS_DEGREE_ADDR) / factor; LOG(DEBUG_EEPROM, "[EEPROM]: ALT Normed Marker Present! ALT steps/deg is %f", azStepsPerDegree); +#else + LOG(DEBUG_EEPROM, "[EEPROM]: ALT marker present but ALT axis disabled; ignoring stored value"); +#endif } else { @@ -532,6 +545,7 @@ float EEPROMStore::getALTStepsPerDegree() void EEPROMStore::storeALTStepsPerDegree(float azStepsPerDegree) { // Store steps as 100x steps/deg at 256 MS. +#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) const float factor = SteppingStorageNormalized / ALT_MICROSTEPPING; int32_t val = azStepsPerDegree * factor; LOG(DEBUG_EEPROM, "[EEPROM]: Storing ALT steps to %l (%f)", val, azStepsPerDegree); @@ -539,6 +553,10 @@ void EEPROMStore::storeALTStepsPerDegree(float azStepsPerDegree) updateInt32(ALT_NORM_STEPS_DEGREE_ADDR, val); updateFlagsExtended(ALT_NORM_STEPS_MARKER_FLAG); commit(); // Complete the transaction +#else + LOG(DEBUG_EEPROM, "[EEPROM]: Skipping ALT steps store; ALT axis disabled"); + (void) azStepsPerDegree; +#endif } int16_t EEPROMStore::getLastFlashedVersion() From f1184c330557112acb16d73856d29f2d4c3c5c93 Mon Sep 17 00:00:00 2001 From: Lutz Date: Fri, 7 Nov 2025 17:01:14 -0800 Subject: [PATCH 13/15] Delete clang-format-diff.patch --- clang-format-diff.patch | 448 ---------------------------------------- 1 file changed, 448 deletions(-) delete mode 100644 clang-format-diff.patch diff --git a/clang-format-diff.patch b/clang-format-diff.patch deleted file mode 100644 index b71ab8e0..00000000 --- a/clang-format-diff.patch +++ /dev/null @@ -1,448 +0,0 @@ -diff --git a/ConfigurationValidation.hpp b/ConfigurationValidation.hpp -index 74667a1..82ed67e 100644 ---- a/ConfigurationValidation.hpp -+++ b/ConfigurationValidation.hpp -@@ -90,8 +90,7 @@ - #endif - #endif - #elif defined(BOARD_OAE_V1) -- // Valid -- -+// Valid - - #else - #error Configuration does not support AZ. Use at own risk. -@@ -114,7 +113,7 @@ - #endif - - #elif defined(BOARD_OAE_V1) -- // Valid -+// Valid - - #else - #warning Configuration does not support ALT. Use at own risk. -diff --git a/Configuration_adv.hpp b/Configuration_adv.hpp -index 09ccb3e..cd16833 100644 ---- a/Configuration_adv.hpp -+++ b/Configuration_adv.hpp -@@ -340,13 +340,12 @@ - #ifndef AZ_ROD_PITCH - #define AZ_ROD_PITCH 0.5 - #endif -- #define AZIMUTH_STEPS_PER_REV + \ -- (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev -+ #define AZIMUTH_STEPS_PER_REV \ -+ +(AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev - #else - #define AZ_CIRCUMFERENCE 2538.4f - #endif - #endif -- - - #ifndef OAE - #define AZ_WORMGEAR_RATIO 1.0f -@@ -357,7 +356,7 @@ - (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / (AZ_PULLEY_TEETH * GT2_BELT_PITCH)) * AZ_STEPPER_SPR \ - * AZ_MICROSTEPPING) // Actually u-steps/rev - #endif -- -+ - #ifndef AZIMUTH_STEPS_PER_ARC_MINUTE - #define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps - #endif -@@ -416,15 +415,16 @@ - #define ALTITUDE_STEPS_PER_REV \ - (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev - -- #else -+ #else - #ifdef OAE - #ifndef ALT_ROD_PITCH - #define ALT_ROD_PITCH 1.25 // mm/rev - #endif - // the Circumference of the ALT rotation. Roughly 146mm radius. - #define ALT_CIRCUMFERENCE 130.0f * 2 * PI -- #define ALTITUDE_STEPS_PER_REV + \ -- (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev -+ #define ALTITUDE_STEPS_PER_REV \ -+ +(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR \ -+ * ALT_MICROSTEPPING) // Actually u-steps/rev - #else - // the Circumference of the AZ rotation. 770mm dia. - #define ALT_CIRCUMFERENCE 2419.0f -@@ -436,9 +436,9 @@ - #define ALT_WORMGEAR_RATIO (40.0f) - #endif - #ifndef ALTITUDE_STEPS_PER_REV -- #define ALTITUDE_STEPS_PER_REV \ -- (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \ -- * ALT_WORMGEAR_RATIO) // Actually u-steps/rev -+ #define ALTITUDE_STEPS_PER_REV \ -+ (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR \ -+ * ALT_MICROSTEPPING * ALT_WORMGEAR_RATIO) // Actually u-steps/rev - #endif - #endif - #endif -@@ -649,7 +649,6 @@ - // //////// - //////////////////////////////////////////// - -- - // Focuser - #if (FOCUS_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) - #if defined(ESP32) -diff --git a/Constants.hpp b/Constants.hpp -index 17c0042..f4a9ddd 100644 ---- a/Constants.hpp -+++ b/Constants.hpp -@@ -18,7 +18,7 @@ - - // ESP32 based boards - #define BOARD_ESP32_ESP32DEV 1001 --#define BOARD_OAE_V1 1002 -+#define BOARD_OAE_V1 1002 - - /** - * Supported keypad/display types. Use one of these values for DISPLAY_TYPE configuration matching your used display and keypad. -diff --git a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp -index 1bdb4b9..00d3db6 100644 ---- a/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp -+++ b/boards/ESP32_ESP32DEV/pins_OAE_V1.hpp -@@ -83,13 +83,13 @@ - - // DISPLAY_TYPE_LCD_JOY_I2C_SSD1306 requires 3 analog inputs in Arduino pin numbering - #ifndef LCD_KEY_SENSE_X_PIN -- //#define LCD_KEY_SENSE_X_PIN 34 -+//#define LCD_KEY_SENSE_X_PIN 34 - #endif - #ifndef LCD_KEY_SENSE_Y_PIN -- //#define LCD_KEY_SENSE_Y_PIN 39 -+//#define LCD_KEY_SENSE_Y_PIN 39 - #endif - #ifndef LCD_KEY_SENSE_PUSH_PIN -- //#define LCD_KEY_SENSE_PUSH_PIN 36 -+//#define LCD_KEY_SENSE_PUSH_PIN 36 - #endif - - //Serial port for external debugging -@@ -103,7 +103,6 @@ - #endif - #endif - -- - // Defines for OAE /////////////////////// - - #ifndef RA_WHEEL_CIRCUMFERENCE -@@ -125,7 +124,7 @@ - #define DEC_WHEEL_CIRCUMFERENCE 1.0f - #endif - #ifndef RA_STEPPER_SPR -- #define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper -+ #define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper - #endif - #ifndef DEC_STEPPER_SPR - #define DEC_STEPPER_SPR (200 * 50 * 4.5f) // change to (200 * 9) for 1.8° stepper -diff --git a/src/EPROMStore.cpp b/src/EPROMStore.cpp -index bb20c8e..b82d7be 100644 ---- a/src/EPROMStore.cpp -+++ b/src/EPROMStore.cpp -@@ -469,11 +469,11 @@ void EEPROMStore::storeDECStepsPerDegree(float decStepsPerDegree) - // If it is not present then the default uncalibrated AZ_STEPS_PER_DEGREE value is returned. - float EEPROMStore::getAZStepsPerDegree() - { -- #if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE -+#if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE - float azStepsPerDegree(AZIMUTH_STEPS_PER_REV / 360); // Default value -- #else -+#else - float azStepsPerDegree(1); // Default value -- #endif -+#endif - - if (isPresentExtended(AZ_NORM_STEPS_MARKER_FLAG)) - { -@@ -503,16 +503,15 @@ void EEPROMStore::storeAZStepsPerDegree(float azStepsPerDegree) - commit(); // Complete the transaction - } - -- - // Return the ALT steps per degree (actually microsteps per degree). - // If it is not present then the default uncalibrated ALT_STEPS_PER_DEGREE value is returned. - float EEPROMStore::getALTStepsPerDegree() - { -- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) -+#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) - float azStepsPerDegree(ALTITUDE_STEPS_PER_REV / 360); // Default value -- #else -+#else - float azStepsPerDegree(1); // Default value -- #endif -+#endif - - if (isPresentExtended(ALT_NORM_STEPS_MARKER_FLAG)) - { -@@ -542,7 +541,6 @@ void EEPROMStore::storeALTStepsPerDegree(float azStepsPerDegree) - commit(); // Complete the transaction - } - -- - int16_t EEPROMStore::getLastFlashedVersion() - { - if (isPresentExtended(LAST_FLASHED_MARKER_FLAG)) -diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp -index 7bbe7ec..0788954 100644 ---- a/src/MeadeCommandProcessor.cpp -+++ b/src/MeadeCommandProcessor.cpp -@@ -1858,11 +1858,11 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) - } - else if ((inCmd[1] == 'A') && (inCmd.length() == 2)) // :XGA# - { -- return String(_mount->getStepsPerDegree(ALTITUDE_STEPS),1) + "#"; -+ return String(_mount->getStepsPerDegree(ALTITUDE_STEPS), 1) + "#"; - } - else if ((inCmd[1] == 'Z') && (inCmd.length() == 2)) // :XGZ# - { -- return String(_mount->getStepsPerDegree(AZIMUTH_STEPS),1) + "#"; -+ return String(_mount->getStepsPerDegree(AZIMUTH_STEPS), 1) + "#"; - } - else if ((inCmd[1] == 'A') && (inCmd.length() > 2) && (inCmd[2] == 'H')) // :XGAH# - { -diff --git a/src/Mount.cpp b/src/Mount.cpp -index 9ceca38..bd2a94b 100644 ---- a/src/Mount.cpp -+++ b/src/Mount.cpp -@@ -78,7 +78,7 @@ Mount::Mount(LcdMenu *lcdMenu) - - { - _commandReceived = 0; -- _lcdMenu = lcdMenu; -+ _lcdMenu = lcdMenu; - initializeVariables(); - } - -@@ -190,15 +190,15 @@ void Mount::readPersistentData() - _stepsPerDECDegree = EEPROMStore::getDECStepsPerDegree(); - LOG(DEBUG_INFO, "[MOUNT]: EEPROM: DEC steps/deg is %f", _stepsPerDECDegree); - -- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) -+#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) - _stepsPerAZDegree = EEPROMStore::getAZStepsPerDegree(); - LOG(DEBUG_INFO, "[MOUNT]: EEPROM: AZ steps/deg is %f", _stepsPerAZDegree); -- #endif -+#endif - -- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) -+#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) - _stepsPerALTDegree = EEPROMStore::getALTStepsPerDegree(); - LOG(DEBUG_INFO, "[MOUNT]: EEPROM: ALT steps/deg is %f", _stepsPerALTDegree); -- #endif -+#endif - float speed = EEPROMStore::getSpeedFactor(); - LOG(DEBUG_INFO, "[MOUNT]: EEPROM: Speed factor is %f", speed); - setSpeedCalibration(speed, false); -@@ -1003,19 +1003,19 @@ float Mount::getStepsPerDegree(StepperAxis which) - } - if (which == AZIMUTH_STEPS) - { -- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) -+#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) - return _stepsPerAZDegree; // u-steps/degree -- #else -+#else - return 1; -- #endif -+#endif - } - if (which == ALTITUDE_STEPS) - { -- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) -+#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) - return _stepsPerALTDegree; // u-steps/degree -- #else -+#else - return 1; -- #endif -+#endif - } - - return 0; -@@ -1040,20 +1040,20 @@ void Mount::setStepsPerDegree(StepperAxis which, float steps) - EEPROMStore::storeRAStepsPerDegree(_stepsPerRADegree); - setSpeedCalibration(_trackingSpeedCalibration, false); - } -- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) -+#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) - else if (which == AZIMUTH_STEPS) - { - _stepsPerAZDegree = steps; - EEPROMStore::storeAZStepsPerDegree(_stepsPerAZDegree); - } -- #endif -- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) -+#endif -+#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) - else if (which == ALTITUDE_STEPS) - { - _stepsPerALTDegree = steps; - EEPROMStore::storeALTStepsPerDegree(_stepsPerALTDegree); - } -- #endif -+#endif - } - - ///////////////////////////////// -@@ -1621,13 +1621,13 @@ void Mount::stopGuiding(bool ra, bool dec) - // Stop DEC guiding and wait for it to stop. - _stepperGUIDE->stop(); - -- #if !defined(ESP32BOARD) -+#if !defined(ESP32BOARD) - while (_stepperGUIDE->isRunning()) - { - _stepperGUIDE->run(); - _stepperTRK->runSpeed(); - } -- #endif -+#endif - - _mountStatus &= ~STATUS_GUIDE_PULSE_DEC; - } -@@ -2678,9 +2678,7 @@ void Mount::waitUntilStopped(byte direction) - // Block until all steppers are stopped - void Mount::waitUntilAllStopped() - { -- while (_stepperRA->isRunning() -- || _stepperDEC->isRunning() -- || (((_mountStatus & STATUS_TRACKING) == 0) && _stepperTRK->isRunning()) -+ while (_stepperRA->isRunning() || _stepperDEC->isRunning() || (((_mountStatus & STATUS_TRACKING) == 0) && _stepperTRK->isRunning()) - #if FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE - || _stepperFocus->isRunning() - #endif -@@ -3028,12 +3026,12 @@ void Mount::loop() - // One of the motors was running last time through the loop, but not anymore, so shutdown the outputs. - disableAzAltMotors(); - _azAltWasRunning = false; -- #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) -- EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); -- #endif -- #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) -- EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); -- #endif -+ #if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE) -+ EEPROMStore::storeAZPosition(_stepperAZ->currentPosition()); -+ #endif -+ #if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE) -+ EEPROMStore::storeALTPosition(_stepperALT->currentPosition()); -+ #endif - } - - oneIsRunning = false; -@@ -3305,16 +3303,16 @@ void Mount::updateInfoDisplay() - { - #if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE) - // If we update this display too often while slewing, the serial port is unable to process commands fast enough. Which makes the driver -- // timeout, causing ASCOM errors. -+ // timeout, causing ASCOM errors. - // We will update at 30Hz when idle, 5Hz when slewing one axis and skip updates when slewing both. - int refreshRateHz = 30; -- long now = millis(); -- if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA)) -+ long now = millis(); -+ if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA)) - { - return; - } -- -- if (isSlewingRAorDEC()) -+ -+ if (isSlewingRAorDEC()) - { - refreshRateHz = 5; - } -diff --git a/src/Mount.hpp b/src/Mount.hpp -index 1d170f9..7cf00a7 100644 ---- a/src/Mount.hpp -+++ b/src/Mount.hpp -@@ -406,7 +406,7 @@ class Mount - void setupInfoDisplay(); - void updateInfoDisplay(); - InfoDisplayRender *getInfoDisplay(); -- long _lastInfoUpdate = 0; // Last time the info display was updated -+ long _lastInfoUpdate = 0; // Last time the info display was updated - #endif - - // Called by Meade processor every time a command is received. -diff --git a/src/b_setup.hpp b/src/b_setup.hpp -index 2d9e269..5ac294a 100644 ---- a/src/b_setup.hpp -+++ b/src/b_setup.hpp -@@ -181,9 +181,9 @@ void setup() - - #ifdef RA_SERIAL_PORT - #ifdef OAE -- RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); -+ RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_TX_PIN, RA_RX_PIN); - #else -- RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver -+ RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver - #endif - // - #endif -@@ -204,13 +204,13 @@ void setup() - #if DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART - // include TMC2209 UART pins - #if defined(DEC_DIAG_PIN) -- pinMode(DEC_DIAG_PIN, INPUT); -+ pinMode(DEC_DIAG_PIN, INPUT); - #endif - #ifdef DEC_SERIAL_PORT - #ifdef OAE -- DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); -+ DEC_SERIAL_PORT.begin(57600, SERIAL_8N1, DEC_TX_PIN, DEC_RX_PIN); - #else -- DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver -+ DEC_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver - #endif - #endif - #endif -@@ -456,7 +456,7 @@ void setup() - LOG(DEBUG_ANY, "[STEPPERS]: ALT Circumference : %f", ALT_CIRCUMFERENCE); - LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/rev : %f", ALTITUDE_STEPS_PER_REV); - LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/deg : %f", mount.getStepsPerDegree(ALTITUDE_STEPS)); -- LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); -+ LOG(DEBUG_ANY, "[STEPPERS]: ALT steps/minute : %f", ALTITUDE_STEPS_PER_ARC_MINUTE); - mount.configureALTStepper(ALTmotorPin1, ALTmotorPin2, ALT_STEPPER_SPEED, ALT_STEPPER_ACCELERATION); - #if ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART - LOG(DEBUG_ANY, "[STEPPERS]: Configure ALT driver..."); -diff --git a/src/testmenu.cpp b/src/testmenu.cpp -index 0dcabb5..b046bf4 100644 ---- a/src/testmenu.cpp -+++ b/src/testmenu.cpp -@@ -261,12 +261,12 @@ void TestMenu::listHardware() const - int index = 0; - Serial.print(F(" Mount: ")); - #ifdef OAM -- Serial.println(F("OpenAstroMount (OAM)")); -+ Serial.println(F("OpenAstroMount (OAM)")); - #else - #ifdef OAE -- Serial.println(F("OpenAstroExplorer (OAE)")); -+ Serial.println(F("OpenAstroExplorer (OAE)")); - #else -- Serial.println(F("OpenAstroTracker (OAT)")); -+ Serial.println(F("OpenAstroTracker (OAT)")); - #endif - #endif - -@@ -534,9 +534,9 @@ void TestMenu::display() const - Serial.println(F("*** OpenAstroMount (OAM) Test Menu ***")); - #else - #ifdef OAE -- Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); -+ Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); - #else -- Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); -+ Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); - #endif - #endif - Serial.print(F("************* ")); From 790a953e3a67ad9399e8895cc39772c051e92099 Mon Sep 17 00:00:00 2001 From: Lutz Date: Tue, 4 Nov 2025 20:40:59 -0800 Subject: [PATCH 14/15] Fix typo --- src/MeadeCommandProcessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index 370ea4b3..de66f0f3 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -859,7 +859,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // "float#" // // :XGT# -// Descrition: +// Description: // Get Tracking speed // Information: // Get the absolute tracking speed of the mount. From 4705edd982d3ccbd636c6b7badfe20f71c6188e2 Mon Sep 17 00:00:00 2001 From: Lutz Date: Fri, 7 Nov 2025 17:06:39 -0800 Subject: [PATCH 15/15] Typo fixes --- src/b_setup.hpp | 2 +- src/testmenu.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/b_setup.hpp b/src/b_setup.hpp index e8cb3534..68c997bf 100644 --- a/src/b_setup.hpp +++ b/src/b_setup.hpp @@ -283,7 +283,7 @@ void setup() #ifdef OAM lcdMenu.printMenu(" OpenAstroMount"); #elif defined(OAE) - lcdMenu.printMenu(" OpenAstroExplorer"); + lcdMenu.printMenu("OpenAstroExplorer"); #else lcdMenu.printMenu("OpenAstroTracker"); #endif diff --git a/src/testmenu.cpp b/src/testmenu.cpp index b046bf42..1b0d1763 100644 --- a/src/testmenu.cpp +++ b/src/testmenu.cpp @@ -534,7 +534,7 @@ void TestMenu::display() const Serial.println(F("*** OpenAstroMount (OAM) Test Menu ***")); #else #ifdef OAE - Serial.println(F("*** OpenAstroTracker (OAE) Test Menu ***")); + Serial.println(F("*** OpenAstroExplorer (OAE) Test Menu ***")); #else Serial.println(F("** OpenAstroTracker (OAT) Test Menu **")); #endif