Skip to content

Commit 83eefc1

Browse files
V1.8.53 - Updates
- Enforced DEC limits on slew movements. There is currently no indication that limiting has occurred. - Added display of DEC limits to INFO screen. - Changed some logging output.
1 parent 6cc5ebd commit 83eefc1

File tree

4 files changed

+70
-10
lines changed

4 files changed

+70
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define VERSION "V1.8.52"
1+
#define VERSION "V1.8.53"

Software/Arduino code/OpenAstroTracker/src/Mount.cpp

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ const DayTime Mount::HA() const {
919919
DayTime ha = _LST;
920920
// LOGV2(DEBUG_MOUNT_VERBOSE, F("Mount: LST: %s"), _LST.ToString());
921921
ha.subtractTime(DayTime(POLARIS_RA_HOUR, POLARIS_RA_MINUTE, POLARIS_RA_SECOND));
922-
LOGV2(DEBUG_MOUNT, F("Mount: GetHA: LST-Polaris is HA %s"), ha.ToString());
922+
// LOGV2(DEBUG_MOUNT, F("Mount: GetHA: LST-Polaris is HA %s"), ha.ToString());
923923
return ha;
924924
}
925925

@@ -1757,20 +1757,42 @@ void Mount::startSlewing(int direction) {
17571757
_driverRA->microsteps(SET_MICROSTEPPING);
17581758
#endif
17591759
#endif
1760-
LOGV1(DEBUG_STEPPERS, F("STEP-startSlewing: call moveTo() on stepper"));
1760+
17611761
if (direction & NORTH) {
1762-
_stepperDEC->moveTo(sign * 300000);
1762+
long targetLocation = sign * 300000;
1763+
if (_decUpperLimit != 0) {
1764+
targetLocation = _decUpperLimit;
1765+
LOGV3(DEBUG_STEPPERS, F("STEP-startSlewing(N): DEC has upper limit of %l. targetMoveTo is now %l"), _decUpperLimit, targetLocation);
1766+
}
1767+
else {
1768+
LOGV2(DEBUG_STEPPERS, F("STEP-startSlewing(N): initial targetMoveTo is %l"), targetLocation);
1769+
}
1770+
1771+
_stepperDEC->moveTo(targetLocation);
17631772
_mountStatus |= STATUS_SLEWING;
17641773
}
1774+
17651775
if (direction & SOUTH) {
1766-
_stepperDEC->moveTo(-sign * 300000);
1776+
long targetLocation = -sign * 300000;
1777+
if (_decLowerLimit != 0) {
1778+
targetLocation = _decLowerLimit;
1779+
LOGV3(DEBUG_STEPPERS, F("STEP-startSlewing(S): DEC has lower limit of %l. targetMoveTo is now %l"), _decLowerLimit, targetLocation);
1780+
}
1781+
else {
1782+
LOGV2(DEBUG_STEPPERS, F("STEP-startSlewing(S): initial targetMoveTo is %l"), targetLocation);
1783+
}
1784+
1785+
_stepperDEC->moveTo(targetLocation);
17671786
_mountStatus |= STATUS_SLEWING;
17681787
}
1788+
17691789
if (direction & EAST) {
1790+
LOGV2(DEBUG_STEPPERS, F("STEP-startSlewing(E): initial targetMoveTo is %l"), -sign * 300000);
17701791
_stepperRA->moveTo(-sign * 300000);
17711792
_mountStatus |= STATUS_SLEWING;
17721793
}
17731794
if (direction & WEST) {
1795+
LOGV2(DEBUG_STEPPERS, F("STEP-startSlewing(W): initial targetMoveTo is %l"), sign * 300000);
17741796
_stepperRA->moveTo(sign * 300000);
17751797
_mountStatus |= STATUS_SLEWING;
17761798
}
@@ -1907,7 +1929,8 @@ void Mount::loop() {
19071929
interruptLoop();
19081930
#endif
19091931

1910-
#if DEBUG_LEVEL&DEBUG_MOUNT
1932+
#if DEBUG_LEVEL & (DEBUG_MOUNT && DEBUG_VERBOSE)
1933+
unsigned long now = millis();
19111934
if (now - _lastMountPrint > 2000) {
19121935
Serial.println(getStatusString());
19131936
_lastMountPrint = now;
@@ -1975,7 +1998,7 @@ void Mount::loop() {
19751998
_mountStatus &= ~(STATUS_SLEWING | STATUS_SLEWING_TO_TARGET);
19761999

19772000
if (_stepperWasRunning) {
1978-
LOGV1(DEBUG_MOUNT|DEBUG_STEPPERS,F("Mount::Loop: Reached target."));
2001+
LOGV3(DEBUG_MOUNT|DEBUG_STEPPERS,F("Mount::Loop: Reached target. RA:%l, DEC:%l"), _stepperRA->currentPosition(), _stepperDEC->currentPosition());
19792002
// Mount is at Target!
19802003
// If we we're parking, we just reached home. Clear the flag, reset the motors and stop tracking.
19812004
if (isParking()) {
@@ -2129,6 +2152,16 @@ void Mount::clearDecLimitPosition(bool upper) {
21292152
}
21302153
}
21312154

2155+
/////////////////////////////////
2156+
//
2157+
// getDecLimitPositions
2158+
//
2159+
/////////////////////////////////
2160+
void Mount::getDecLimitPositions(long & lowerLimit, long & upperLimit) {
2161+
lowerLimit = _decLowerLimit;
2162+
upperLimit = _decUpperLimit;
2163+
}
2164+
21322165
/////////////////////////////////
21332166
//
21342167
// setHome
@@ -2323,6 +2356,16 @@ void Mount::moveSteppersTo(float targetRA, float targetDEC) {
23232356
}
23242357

23252358
_stepperRA->moveTo(targetRA);
2359+
2360+
if (_decUpperLimit != 0) {
2361+
targetDEC = min(targetDEC, _decUpperLimit);
2362+
LOGV2(DEBUG_MOUNT,F("Mount::MoveSteppersTo: DEC Upper Limit enforced. To: %f"), targetDEC);
2363+
}
2364+
if (_decLowerLimit != 0) {
2365+
targetDEC = max(targetDEC, _decLowerLimit);
2366+
LOGV2(DEBUG_MOUNT,F("Mount::MoveSteppersTo: DEC Lower Limit enforced. To: %f"), targetDEC);
2367+
}
2368+
23262369
_stepperDEC->moveTo(targetDEC);
23272370
}
23282371

Software/Arduino code/OpenAstroTracker/src/Mount.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ class Mount {
214214
// Clear the DEC limit position. If upper is true, clears upper limit, else the lower limit.
215215
void clearDecLimitPosition(bool upper);
216216

217+
// Get the DEC limit positions
218+
void getDecLimitPositions(long & lowerLimit, long & upperLimit);
219+
217220
// Auto Home with TMC2209 UART
218221
#if (RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) || (DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART)
219222
void startFindingHomeRA();

Software/Arduino code/OpenAstroTracker/src/c78_menuINFO.hpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#if SUPPORT_INFO_DISPLAY == 1
66
byte infoIndex = 0;
7-
byte maxInfoIndex = 7;
7+
byte maxInfoIndex = 9;
88
byte subIndex = 0;
99
unsigned long lastInfoUpdate = 0;
1010

@@ -108,12 +108,26 @@ void printStatusSubmenu() {
108108
break;
109109

110110
case 5: {
111+
long lowerLimit, upperLimit;
112+
mount.getDecLimitPositions(lowerLimit, upperLimit);
113+
lcdMenu.printMenu("DEC Lo: "+String(lowerLimit));
114+
}
115+
break;
116+
117+
case 6: {
118+
long lowerLimit, upperLimit;
119+
mount.getDecLimitPositions(lowerLimit, upperLimit);
120+
lcdMenu.printMenu("DEC Up: "+String(upperLimit));
121+
}
122+
break;
123+
124+
case 7: {
111125
sprintf(scratchBuffer, "MemAvail: %d", freeMemory());
112126
lcdMenu.printMenu(scratchBuffer);
113127
}
114128
break;
115129

116-
case 6: {
130+
case 8: {
117131
long now = millis();
118132
long msPerDay = 60L * 60 * 24 * 1000;
119133
int days = (int)(now / msPerDay);
@@ -124,7 +138,7 @@ void printStatusSubmenu() {
124138
}
125139
break;
126140

127-
case 7: {
141+
case 9: {
128142
lcdMenu.printMenu("Firmw.: " + String(VERSION));
129143
}
130144
break;

0 commit comments

Comments
 (0)