Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.pio
.vscode
venv
.venv
__pycache__
.idea
cmake-*
CMakeLists.txt
Expand All @@ -11,3 +9,6 @@ build_cache

Configuration_local*
MeadeToWikiOutput.txt

!Configuration_local_examples/
!Configuration_local_examples/*
40 changes: 1 addition & 39 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,3 @@
**V1.13.19 - Updates**
- Support inverting and mirroring InfoDisplays.

**V1.13.18 - Updates**
- Final changes for OAE

**V1.13.17 - Updates**
- Store AZ/ALT steps per degree and allow them to be set from Meade
- Added more output to the InfoDisplay during boot and fixed a bug in console mode.
- Fixed a bug that was causing the firmware to hang after a slew, if a :Q# command was issued (thanks to user c3n for tracking it down, pun intended).

**V1.13.16 - Updates**
- Throttled InfoDisplay updates. Turned off on two axis slew, limited to 5Hz on one-axis slew.
- Guide pulses are now ignored for DEC as well when at the limits.

**V1.13.15 - Updates**
- Changes necessary for OAE, add OAE board
- Check `INFO_DISPLAY_TYPE` builds in CI
- Fix `INFO_DISPLAY_TYPE_I2C_SSD1306_128x64` for esp32 builds

**V1.13.14 - Updates**
- Improved Serial command handling (made it less 'blocking'), which should improve general performance
- Guide pulses are ignored when tracking is disabled (for example, when at the limits)

**V1.13.13 - Updates**
- Improved Meade command documentation
- Fixed a bug that was not correctly showing the stepper direction in the :GX# command reply./

**V1.13.12 - Updates**
- Parallelize matrix_build.py for faster CI builds
- Added basic test mode that can be run via terminal connection.

**V1.13.11 - Updates**
- Fixed DEBUG macro usage.
- Clarified some Meade documentation.

**V1.13.10 - Updates**
- Fixed dependency specification for git tags

**V1.13.9 - Updates**
- Added guide logging support.
- Fixed some Meade documentation errors.
Expand Down Expand Up @@ -68,6 +29,7 @@ NOTE: Make sure to do a Factory Reset when using this version.
- Lowered ESP32 second core priority
- Added support for informational display
- You must upgrade to OATControl V1.1.2.0 to use with this version (at least if you want to use teh DEC park/unpark feature)

**V1.13.2 - Updates**
- Fix for RA steps being incorrectly set on every boot.

Expand Down
6 changes: 4 additions & 2 deletions Configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,16 @@
#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)
#include "boards/AVR_MKS_GEN_L_V2/pins_MKS_GEN_L_V2.h"
#elif (BOARD == BOARD_AVR_MKS_GEN_L_V21)
#include "boards/AVR_MKS_GEN_L_V21/pins_MKS_GEN_L_V21.h"
#elif (BOARD == BOARD_RP2040_JACKW01)
#include "boards/RP2040_JACKW01/pins_RP2040_JACKW01.hpp"
#elif (BOARD == BOARD_RP2040_SKR_PICO)
#include "boards/RP2040_SKR_PICO/pins_RP2040_SKR_PICO.hpp"
#endif

#include "Configuration_adv.hpp"
Expand Down
35 changes: 24 additions & 11 deletions ConfigurationValidation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#endif

// Platform
#if defined(ESP32) || defined(__AVR_ATmega2560__)
#if defined(ESP32) || defined(__AVR_ATmega2560__) || defined(ARDUINO_ARCH_RP2040)
// Valid platform
#else
#error Unsupported platform configuration. Use at own risk.
Expand All @@ -30,6 +30,8 @@
&& ((DISPLAY_TYPE == DISPLAY_TYPE_NONE) || (DISPLAY_TYPE == DISPLAY_TYPE_LCD_KEYPAD) || (DISPLAY_TYPE_LCD_KEYPAD_I2C_MCP23008) \
|| (DISPLAY_TYPE_LCD_KEYPAD_I2C_MCP23017))
// Valid display for ATmega
#elif defined(ARDUINO_ARCH_RP2040) && (DISPLAY_TYPE == DISPLAY_TYPE_NONE)
// Valid display for RP2040 (no display in Phase 1)
#else
#error Unsupported display configuration. Use at own risk.
#endif
Expand Down Expand Up @@ -81,16 +83,15 @@
#else
#error Defined an AZ driver, but no AZ stepper.
#endif
#elif defined(__AVR_ATmega2560__)
#elif defined(__AVR_ATmega2560__) || defined(ARDUINO_ARCH_RP2040)
// Azimuth configuration
#if (AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART)
#ifndef AZ_DRIVER_ADDRESS
// Serial bus address must be specified for TMC2209 in UART mode
#error AZ driver address for DRIVER_TYPE_TMC2209_UART not specified.
#endif
#endif
#elif defined(OAE)
// Valid OAE configuration

#else
#error Configuration does not support AZ. Use at own risk.
#endif
Expand All @@ -102,7 +103,7 @@
#else
#error Defined an ALT driver, but no ALT stepper.
#endif
#elif defined(__AVR_ATmega2560__)
#elif defined(__AVR_ATmega2560__) || defined(ARDUINO_ARCH_RP2040)
// Altitude configuration
#if (ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART)
#ifndef ALT_DRIVER_ADDRESS
Expand Down Expand Up @@ -166,8 +167,8 @@
// External sensors
#if (USE_GPS == 0)
// Baseline configuration without GPS is valid
#elif defined(ESP32) || defined(__AVR_ATmega2560__)
// GPS is supported on ESP32 and ATmega
#elif defined(ESP32) || defined(__AVR_ATmega2560__) || defined(ARDUINO_ARCH_RP2040)
// GPS is supported on ESP32, ATmega, and RP2040
#else
#error Unsupported GPS configuration. Use at own risk.
#endif
Expand Down Expand Up @@ -197,7 +198,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)
#if !defined(DEC_STEP_PIN) || !defined(DEC_DIR_PIN) || !defined(DEC_EN_PIN) || !defined(DEC_DIAG_PIN)
// Required pin assignments missing
#error Missing pin assignments for configured DEC DRIVER_TYPE_TMC2209_UART driver
#endif
Expand All @@ -217,7 +218,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)
#if !defined(RA_STEP_PIN) || !defined(RA_DIR_PIN) || !defined(RA_EN_PIN) || !defined(RA_DIAG_PIN)
// Required pin assignments missing
#error Missing pin assignments for configured RA DRIVER_TYPE_TMC2209_UART driver
#endif
Expand All @@ -229,7 +230,7 @@

#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)
#if !defined(AZ_STEP_PIN) || !defined(AZ_DIR_PIN) || !defined(AZ_EN_PIN) || !defined(AZ_DIAG_PIN)
// Required pin assignments missing
#error Missing pin assignments for configured AZ DRIVER_TYPE_A4988_GENERIC or DRIVER_TYPE_TMC2209_STANDALONE driver
#endif
Expand All @@ -238,6 +239,12 @@
// Required pin assignments missing (ATmega uses SoftwareSerial for this driver)
#error Missing pin assignments for configured AZ DRIVER_TYPE_TMC2209_UART driver
#endif
#if !defined(AZ_DIAG_PIN)
// AZ_DIAG_PIN (TMC2209 DIAG output) is used only for stallGuard-based homing.
// It is optional: omit it if your hardware does not wire the DIAG output to a GPIO.
// Without it, stallGuard homing is unavailable but all other AZ motion works normally.
#pragma message "AZ_DIAG_PIN not defined. StallGuard homing unavailable for AZ axis."
#endif
#if !((defined(AZ_SERIAL_PORT_TX) && defined(AZ_SERIAL_PORT_RX)) || defined(AZ_SERIAL_PORT))
// Required pin assignments missing for UART serial
#error Missing pin assignments for configured AZ DRIVER_TYPE_TMC2209_UART driver serial connection
Expand All @@ -247,7 +254,7 @@

#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)
#if !defined(ALT_STEP_PIN) || !defined(ALT_DIR_PIN) || !defined(ALT_EN_PIN) || !defined(ALT_DIAG_PIN)
// Required pin assignments missing
#error Missing pin assignments for configured AZ DRIVER_TYPE_A4988_GENERIC or DRIVER_TYPE_TMC2209_STANDALONE driver
#endif
Expand All @@ -256,6 +263,12 @@
// Required pin assignments missing (ATmega uses SoftwareSerial for this driver)
#error Missing pin assignments for configured ALT DRIVER_TYPE_TMC2209_UART driver
#endif
#if !defined(ALT_DIAG_PIN)
// ALT_DIAG_PIN (TMC2209 DIAG output) is used only for stallGuard-based homing.
// It is optional: omit it if your hardware does not wire the DIAG output to a GPIO.
// Without it, stallGuard homing is unavailable but all other ALT motion works normally.
#pragma message "ALT_DIAG_PIN not defined. StallGuard homing unavailable for ALT axis."
#endif
#if !((defined(ALT_SERIAL_PORT_TX) && defined(ALT_SERIAL_PORT_RX)) || defined(ALT_SERIAL_PORT))
// Required pin assignments missing for UART serial
#error Missing pin assignments for configured ALT DRIVER_TYPE_TMC2209_UART driver serial connection
Expand Down
95 changes: 36 additions & 59 deletions Configuration_adv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@
#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 ////////
Expand Down Expand Up @@ -241,14 +232,14 @@
#endif

#ifndef DEC_LIMIT_UP
#if defined(OAM) || defined(OAE)
#ifdef OAM
#define DEC_LIMIT_UP 135.0f
#else
#define DEC_LIMIT_UP 0.0f
#endif
#endif
#ifndef DEC_LIMIT_DOWN
#if defined(OAM) || defined(OAE)
#ifdef OAM
#define DEC_LIMIT_DOWN 135.0f
#else
#define DEC_LIMIT_DOWN 0.0f
Expand Down Expand Up @@ -341,34 +332,16 @@
#define AZ_STEPPER_ACCELERATION (100 * AZ_MICROSTEPPING)
#endif

// the Circumference of the AZ rotation. 808mm dia (OAT)
// the Circumference of the AZ rotation. 808mm dia.
#ifndef AZ_CIRCUMFERENCE
#ifdef OAE
// Roughly from the joint to the rod placement is 70mm
#define AZ_CIRCUMFERENCE 56.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
#define AZ_CIRCUMFERENCE 2538.4f
#endif

#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) // 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
#define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps

// AZ TMC2209 UART settings
// These settings work only with TMC2209 in UART connection (single wire to TX)
Expand Down Expand Up @@ -400,7 +373,7 @@
#define ALT_MICROSTEPPING 4
#endif
#ifndef ALT_STEPPER_SPR
#define ALT_STEPPER_SPR (400.0) // NEMA 0.9° = 400 | NEMA 1.8° = 200
#define ALT_STEPPER_SPR 400 // NEMA 0.9° = 400 | NEMA 1.8° = 200
#endif
#ifndef ALT_STEPPER_SPEED
#define ALT_STEPPER_SPEED 2000
Expand All @@ -418,37 +391,24 @@
#define ALT_ROD_PITCH 1.0 // mm/rev
#endif
// the Circumference of the AZ rotation. 209.1mm radius.
#ifndef ALT_CIRCUMFERENCE
#define ALT_CIRCUMFERENCE 209.1 * 2 * PI
#endif
#define ALT_CIRCUMFERENCE 209.1 * 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
#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
// 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 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
// 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

Expand Down Expand Up @@ -658,6 +618,23 @@
// ////////
////////////////////////////////////////////

// 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)
#if defined(ESP32)
Expand Down
Loading
Loading