Skip to content

Commit 3c2a8fa

Browse files
V1.8.04 - Updates
- Merged develop into here - Made AzAlt motors configurable. - Added extensions to the Meade protocol (:MAZn.n# and :MALn.n#) to move the aziumth and altitude motors. - Added Az and ALt motor status to :GX# command output - Added GPS and AzAlt features to hardware info query (:XGM#)
1 parent 0b31ee4 commit 3c2a8fa

File tree

10 files changed

+188
-335
lines changed

10 files changed

+188
-335
lines changed

Software/Arduino code/OpenAstroTracker/Configuration.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
=======================================================================================================================================
1919
*/
2020

21-
String version = "V1.8.03";
21+
String version = "V1.8.04";
2222

2323
///////////////////////////////////////////////////////////////////////////
2424
// Also use Configuration_adv for further adjustments!

Software/Arduino code/OpenAstroTracker/Configuration_adv.hpp

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,32 @@
109109
#define LCD_BUTTON_TEST 0
110110

111111

112+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
113+
// ///
114+
// HARDWARE EXTENSIONS SUPPORT SECTION ///
115+
// ///
116+
//////////////////////////////////////////
117+
//
118+
// Set this to 1 if the mount has motorized Azimuth and Altitude adjustment. Set pins in configuration_pins.hpp
119+
#define AZIMUTH_ALTITUDE_MOTORS 0
120+
121+
#define AZIMUTH_MAX_SPEED 500
122+
#define AZIMUTH_MAX_ACCEL 400
123+
#define AZIMUTH_ARC_SECONDS_PER_STEP (3.99985f)
124+
#define AZIMUTH_STEPS_PER_ARC_MINUTE (60.0f/AZIMUTH_ARC_SECONDS_PER_STEP)
125+
126+
#define ALTITUDE_MAX_SPEED 500
127+
#define ALTITUDE_MAX_ACCEL 400
128+
#define ALTITUDE_ARC_SECONDS_PER_STEP (0.61761f)
129+
#define ALTITUDE_STEPS_PER_ARC_MINUTE (60.0f/ALTITUDE_ARC_SECONDS_PER_STEP)
130+
131+
//
132+
// Set this to 1 if you are using a NEO6m GPS module for HA/LST and location automatic determination.
133+
//
134+
#define USE_GPS 0
135+
// If supported, download the library https://github.com/mikalhart/TinyGPSPlus/releases and extract it to C:\Users\*you*\Documents\Arduino\libraries
136+
137+
112138

113139
#if HEADLESS_CLIENT == 0 // <-- Ignore this line
114140
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -150,10 +176,6 @@
150176
// Set this to 1 to support Serial Meade LX200 protocol support
151177
#define SUPPORT_SERIAL_CONTROL 1
152178

153-
// Set this to 1 if you are using a NEO6m GPS module
154-
// Download this library https://github.com/mikalhart/TinyGPSPlus/releases and extract it to C:\Users\*you*\Documents\Arduino\libraries
155-
#define USE_GPS 0
156-
157179
#endif // HEADLESS_CLIENT <-- Ignore this
158180

159181

Software/Arduino code/OpenAstroTracker/Configuration_pins.hpp

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,24 @@
3636
#define DEC_SERIAL_PORT Serial3 // HardwareSerial port, wire to TX2 for write-only
3737
#define DEC_DRIVER_ADDRESS 0b01 // Set by MS1/MS2 (MS1 HIGH, MS2 LOW)
3838
#define DEC_DIAG_PIN 41 // only needed for autohome function
39+
40+
#if AZIMUTH_ALTITUDE_MOTORS == 1
41+
// Azimuth and Altitude pins
42+
#define AZ_IN1_PIN 38
43+
#define AZ_IN2_PIN 40
44+
#define AZ_IN3_PIN 42
45+
#define AZ_IN4_PIN 44
46+
#define ALT_IN1_PIN 46
47+
#define ALT_IN2_PIN 48
48+
#define ALT_IN3_PIN 50
49+
#define ALT_IN4_PIN 52
50+
#endif
3951
//---------------
40-
// MISC PINS
41-
#define GPS_SERIAL_PORT Serial1
42-
#define GPS_BAUD_RATE 9600
52+
// MISC PINS amd SETTINGS
53+
#if USE_GPS == 1
54+
#define GPS_SERIAL_PORT Serial1
55+
#define GPS_BAUD_RATE 9600
56+
#endif
4357
#endif //mega
4458

4559
////////////////////////////////////////////////////////////////////
@@ -62,6 +76,17 @@
6276
#define DEC_IN3_PIN 5
6377
#define DEC_IN4_PIN 18
6478

79+
#if AZIMUTH_ALTITUDE_MOTORS == 1
80+
#define AZ_IN1_PIN 38
81+
#define AZ_IN2_PIN 40
82+
#define AZ_IN3_PIN 42
83+
#define AZ_IN4_PIN 44
84+
#define ALT_IN1_PIN 46
85+
#define ALT_IN2_PIN 48
86+
#define ALT_IN3_PIN 50
87+
#define ALT_IN4_PIN 52
88+
#endif
89+
6590
// ST4 Input Pins - TODO.
6691
/*#define st4North SD0
6792
#define st4South SD1
@@ -90,6 +115,9 @@
90115
#define DEC_IN3_PIN 16
91116
#define DEC_IN4_PIN 15
92117

118+
#if AZIMUTH_ALTITUDE_MOTORS == 1
119+
#error Azimuth / Altitude motors not currently configured/supported in ESP32
120+
#endif
93121
#if USE_GPS == 1
94122
#error GPS module not currently configured/supported in ESP32
95123
#endif

Software/Arduino code/OpenAstroTracker/Globals.hpp

Lines changed: 0 additions & 158 deletions
This file was deleted.

Software/Arduino code/OpenAstroTracker/MeadeCommandProcessor.cpp

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,25 @@
8585
// :GX#
8686
// Get Mount Status
8787
// Returns: string reflecting the mounts' status. The string is a comma-delimited list of statuses:
88-
// Idle,--T,11219,0,927,071906,+900000,#
89-
// | | | | | | |
90-
// | | | | | | |
91-
// | | | | | | |
92-
// | | | | | | +------------------ [6] The current DEC position
93-
// | | | | | +------------------------- [5] The current RA position
94-
// | | | | +------------------------------- [4] The Tracking stepper position
95-
// | | | +---------------------------------- [3] The DEC stepper position
96-
// | | +-------------------------------------- [2] The RA stepper position
97-
// | +------------------------------------------- [1] The motion state.
98-
// | First character is RA slewing state ('R' is East, 'r' is West, '-' is stopped).
99-
// | Second character is DEC slewing state ('d' is North, 'D' is South, '-' is stopped).
100-
// | Third character is TRK slewing state ('T' is Tracking, '-' is stopped).
101-
// +----------------------------------------------- [0] The mount status. One of 'Idle', 'Parked', 'Parking', 'Guiding', 'SlewToTarget', 'FreeSlew', 'ManualSlew', 'Tracking'
88+
// Idle,--T--,11219,0,927,071906,+900000,#
89+
// | | | | | | |
90+
// | | | | | | |
91+
// | | | | | | |
92+
// | | | | | | +------------------ [6] The current DEC position
93+
// | | | | | +------------------------- [5] The current RA position
94+
// | | | | +------------------------------- [4] The Tracking stepper position
95+
// | | | +---------------------------------- [3] The DEC stepper position
96+
// | | +-------------------------------------- [2] The RA stepper position
97+
// | +-------------------------------------------- [1] The motion state.
98+
// | First character is RA slewing state ('R' is East, 'r' is West, '-' is stopped).
99+
// | Second character is DEC slewing state ('d' is North, 'D' is South, '-' is stopped).
100+
// | Third character is TRK slewing state ('T' is Tracking, '-' is stopped).
101+
// | * Fourth character is AZ slewing state ('Z' and 'z' is adjusting, '-' is stopped).
102+
// | * Fifth character is ALT slewing state ('A' and 'a' is adjusting, '-' is stopped).
103+
// +------------------------------------------------- [0] The mount status. One of 'Idle', 'Parked', 'Parking', 'Guiding', 'SlewToTarget', 'FreeSlew', 'ManualSlew', 'Tracking', 'Homing'
104+
//
105+
// * Az and Alt are optional. The string may only be 3 characters long
106+
//
102107
//
103108
// : Gt#
104109
// Get Site Latitude
@@ -217,6 +222,18 @@
217222
// Where c is one of 'n', 'e', 'w', or 's'.
218223
// Returns: nothing
219224
//
225+
// :MAZn.nn#
226+
// Move Azimuth
227+
// If the scope supports automated azimuth operation, move azimuth by n.nn arcminutes
228+
// Where n.nn is a signed floating point number representing the number of arcminutes to move the mount left or right.
229+
// Returns: nothing
230+
//
231+
// :MALn.nn#
232+
// Move Altitude
233+
// If the scope supports automated altitude operation, move altitude by n.nn arcminutes
234+
// Where n.nn is a signed floating point number representing the number of arcminutes to raise or lower the mount.
235+
// Returns: nothing
236+
//
220237
//------------------------------------------------------------------
221238
// SYNC FAMILY
222239
//
@@ -636,6 +653,18 @@ String MeadeCommandProcessor::handleMeadeMovement(String inCmd) {
636653
return "1";
637654
}
638655
}
656+
else if (inCmd[0] == 'A') {
657+
// Move Azimuth or Altitude by given arcminutes
658+
// :MAZ+32.1# or :MAL-32.1#
659+
float arcMinute = inCmd.substring(2).toFloat();
660+
if (inCmd[1] == 'Z'){
661+
_mount->moveBy(AZIMUTH_STEPS, arcMinute);
662+
}
663+
else if (inCmd[1] == 'L'){
664+
_mount->moveBy(ALTITUDE_STEPS, arcMinute);
665+
}
666+
return "";
667+
}
639668
else if (inCmd[0] == 'e') {
640669
_mount->startSlewing(EAST);
641670
return "";

0 commit comments

Comments
 (0)