Skip to content

Commit 336533e

Browse files
V1.7.25.Az01 - Updates
- Added support for the Azimuth motor in the LCD's CAL menu
1 parent 21d677c commit 336533e

File tree

6 files changed

+210
-79
lines changed

6 files changed

+210
-79
lines changed

Software/Arduino code/OpenAstroTracker/Globals.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#define RA_Stepper_TYPE 0 // 28BYJ-48 = 0 | NEMA = 1
1515
#define DEC_Stepper_TYPE 0 // 28BYJ-48 = 0 | NEMA = 1
1616

17+
// Are we supporting the Azimuth PA motor?
18+
#define AZIMUTH_MOTOR 1
19+
1720
// Make some variables in the sketch files available to the C++ code.
1821
extern bool inSerialControl;
1922
extern String version;
@@ -26,7 +29,6 @@ extern float RACircumference;
2629
extern float DECStepsPerRevolution;
2730
extern int DecPulleyTeeth;
2831

29-
3032
// Debugging output control
3133
// Each bit in the debug level specifies a kind of debug to enable.
3234
#define DEBUG_NONE 0x00
@@ -57,6 +59,7 @@ extern int DecPulleyTeeth;
5759
// #define DEBUG_LEVEL (DEBUG_SERIAL|DEBUG_WIFI|DEBUG_INFO|DEBUG_MOUNT|DEBUG_GENERAL)
5860
// #define DEBUG_LEVEL (DEBUG_ANY)
5961
// #define DEBUG_LEVEL (DEBUG_INFO|DEBUG_MOUNT|DEBUG_GENERAL)
62+
// #define DEBUG_LEVEL (DEBUG_WIFI|DEBUG_MEADE|DEBUG_INFO|DEBUG_GENERAL)
6063
#define DEBUG_LEVEL (DEBUG_NONE)
6164

6265
// Set this to 1 to run a key diagnostic. No tracker functions are on at all.
@@ -80,7 +83,7 @@ extern int DecPulleyTeeth;
8083
#undef HEADLESS_CLIENT
8184
#define HEADLESS_CLIENT 1
8285
#define WIFI_ENABLED
83-
#define INFRA_SSID "YouSSID"
86+
#define INFRA_SSID "YourSSID"
8487
#define INFRA_WPAKEY "YourWPAKey"
8588
#define OAT_WPAKEY "superSecret"
8689
#define HOSTNAME "OATerScope"

Software/Arduino code/OpenAstroTracker/MeadeCommandProcessor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) {
767767
else if (inCmd[1] == 'Y') {
768768
_mount->setSpeed(DEC_STEPS, inCmd.substring(2).toFloat());
769769
}
770+
else if (inCmd[1] == 'Z') {
771+
_mount->setSpeed(AZIMUTH_STEPS, inCmd.substring(2).toFloat());
772+
}
770773
else if (inCmd[1] == 'B') {
771774
_mount->setBacklashCorrection(inCmd.substring(2).toInt());
772775
}

Software/Arduino code/OpenAstroTracker/Mount.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,13 @@ void Mount::configureDECStepper(byte stepMode, byte pin1, byte pin2, byte pin3,
309309
_stepperDEC->setAcceleration(maxAcceleration);
310310
_maxDECSpeed = maxSpeed;
311311
_maxDECAcceleration = maxAcceleration;
312+
313+
#if AZIMUTH_MOTOR
314+
_stepperAZ = new AccelStepper(FULLSTEP, PINA1, PINA3, PINA2, PINA4);
315+
_stepperAZ ->setSpeed(0);
316+
_stepperAZ ->setMaxSpeed(400);
317+
_stepperAZ->setAcceleration(400);
318+
#endif
312319
}
313320
#endif
314321

@@ -842,7 +849,11 @@ void Mount::setSpeed(int which, float speed) {
842849
else if (which == DEC_STEPS) {
843850
_stepperDEC->setSpeed(speed);
844851
}
845-
852+
#if AZIMUTH_MOTOR
853+
else if (which == AZIMUTH_STEPS) {
854+
_stepperAZ->setSpeed(speed);
855+
}
856+
#endif
846857
}
847858

848859
/////////////////////////////////
@@ -1226,6 +1237,11 @@ void Mount::interruptLoop()
12261237
_stepperRA->run();
12271238
}
12281239
}
1240+
1241+
#if AZIMUTH_MOTOR
1242+
_stepperAZ->runSpeed();
1243+
#endif
1244+
12291245
}
12301246

12311247
/////////////////////////////////

Software/Arduino code/OpenAstroTracker/Mount.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#define DEC_STEPS 2
3333
#define SPEED_FACTOR_DECIMALS 3
3434
#define BACKLASH_CORRECTION 4
35+
#define AZIMUTH_STEPS 5
3536

3637
//////////////////////////////////////////////////////////////////
3738
//
@@ -176,7 +177,7 @@ class Mount {
176177
// Toggle the state where we run the motors at a constant speed
177178
void setManualSlewMode(bool state);
178179

179-
// Set the speed of the given motoer
180+
// Set the speed of the given motor
180181
void setSpeed(int which, float speed);
181182

182183
// Set the number of steps to use for backlash correction
@@ -248,6 +249,10 @@ class Mount {
248249
AccelStepper* _stepperRA;
249250
AccelStepper* _stepperDEC;
250251
AccelStepper* _stepperTRK;
252+
253+
#if AZIMUTH_MOTOR
254+
AccelStepper* _stepperAZ;
255+
#endif
251256

252257
unsigned long _guideEndTime;
253258
unsigned long _lastMountPrint = 0;

Software/Arduino code/OpenAstroTracker/OpenAstroTracker.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "Globals.hpp"
2020

21-
String version = "V1.7.25";
21+
String version = "V1.7.25.Az01";
2222

2323
///////////////////////////////////////////////////////////////////////////
2424
// Please see the Globals.h file for configuration of the firmware.

0 commit comments

Comments
 (0)