Skip to content

Commit 22be349

Browse files
V1.7.25.A2 - Updates
- Made LCD ask for arcminutes. Plus-minus 60m at a time (130m is complete range) - Removed speed control for Az/Alt motors
1 parent 490e5fd commit 22be349

File tree

5 files changed

+212
-106
lines changed

5 files changed

+212
-106
lines changed

Software/Arduino code/OpenAstroTracker/Globals.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define DEC_Stepper_TYPE 0 // 28BYJ-48 = 0 | NEMA = 1
1616

1717
// Are we supporting the Azimuth PA motor?
18-
#define AZIMUTH_MOTOR 0
18+
#define AZIMUTH_MOTOR 1
1919

2020
// Make some variables in the sketch files available to the C++ code.
2121
extern bool inSerialControl;

Software/Arduino code/OpenAstroTracker/Mount.cpp

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,11 @@ void Mount::configureDECStepper(byte stepMode, byte pin1, byte pin2, byte pin3,
312312

313313
#if AZIMUTH_MOTOR
314314
_stepperAZ = new AccelStepper(FULLSTEP, 38, 42, 40, 44);
315-
_stepperAZ ->setSpeed(0);
315+
_stepperAZ ->setSpeed(150);
316316
_stepperAZ ->setMaxSpeed(300);
317317
_stepperAZ->setAcceleration(400);
318318
_stepperALT = new AccelStepper(FULLSTEP, 46, 50, 48, 52);
319-
_stepperALT ->setSpeed(0);
319+
_stepperALT ->setSpeed(150);
320320
_stepperALT ->setMaxSpeed(300);
321321
_stepperALT->setAcceleration(400);
322322
#endif
@@ -853,14 +853,6 @@ void Mount::setSpeed(int which, float speed) {
853853
else if (which == DEC_STEPS) {
854854
_stepperDEC->setSpeed(speed);
855855
}
856-
#if AZIMUTH_MOTOR
857-
else if (which == AZIMUTH_STEPS) {
858-
_stepperAZ->setSpeed(speed);
859-
}
860-
else if (which == ALTITUDE_STEPS) {
861-
_stepperALT->setSpeed(speed);
862-
}
863-
#endif
864856
}
865857

866858
/////////////////////////////////
@@ -893,6 +885,29 @@ void Mount::goHome()
893885
_slewingToHome = true;
894886
}
895887

888+
/////////////////////////////////
889+
//
890+
// moveBy
891+
//
892+
/////////////////////////////////
893+
void Mount::moveBy(int direction, float arcMinutes)
894+
{
895+
#if AZIMUTH_MOTORS == 1
896+
if (direction == AZIMUTH_STEPS){
897+
const float azimuthArcSecondsPerStep = 3.939f;
898+
const float azimuthStepsPerArcMinute = 60.0f / azimuthArcSecondsPerStep;
899+
int stepsToMove = arcMinutes*azimuthStepsPerArcMinute ;
900+
_stepperAZ->move(stepsToMove);
901+
}
902+
else if (direction == ALTITUDE_STEPS){
903+
const float altitudeArcSecondsPerStep = 3.939f;
904+
const float altitudeStepsPerArcMinute = 60.0f / altitudeArcSecondsPerStep;
905+
int stepsToMove = arcMinutes * altitudeStepsPerArcMinute ;
906+
_stepperALT->move(stepsToMove);
907+
}
908+
#endif
909+
}
910+
896911
/////////////////////////////////
897912
//
898913
// mountStatus
@@ -1246,8 +1261,8 @@ void Mount::interruptLoop()
12461261
}
12471262

12481263
#if AZIMUTH_MOTOR
1249-
_stepperAZ->runSpeed();
1250-
_stepperALT->runSpeed();
1264+
_stepperAZ->run();
1265+
_stepperALT->run();
12511266
#endif
12521267

12531268
}

Software/Arduino code/OpenAstroTracker/Mount.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ class Mount {
181181
// Set the speed of the given motor
182182
void setSpeed(int which, float speed);
183183

184+
// Support for moving the mount in azimuth and altitude (requires extra hardware)
185+
void moveBy(int direction, float arcMinutes);
186+
184187
// Set the number of steps to use for backlash correction
185188
void setBacklashCorrection(int steps);
186189

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.Az01";
21+
String version = "V1.7.25.A2";
2222

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

0 commit comments

Comments
 (0)