@@ -919,7 +919,7 @@ const DayTime Mount::HA() const {
919
919
DayTime ha = _LST;
920
920
// LOGV2(DEBUG_MOUNT_VERBOSE, F("Mount: LST: %s"), _LST.ToString());
921
921
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());
923
923
return ha;
924
924
}
925
925
@@ -1757,20 +1757,42 @@ void Mount::startSlewing(int direction) {
1757
1757
_driverRA->microsteps (SET_MICROSTEPPING);
1758
1758
#endif
1759
1759
#endif
1760
- LOGV1 (DEBUG_STEPPERS, F ( " STEP-startSlewing: call moveTo() on stepper " ));
1760
+
1761
1761
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);
1763
1772
_mountStatus |= STATUS_SLEWING;
1764
1773
}
1774
+
1765
1775
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);
1767
1786
_mountStatus |= STATUS_SLEWING;
1768
1787
}
1788
+
1769
1789
if (direction & EAST) {
1790
+ LOGV2 (DEBUG_STEPPERS, F (" STEP-startSlewing(E): initial targetMoveTo is %l" ), -sign * 300000 );
1770
1791
_stepperRA->moveTo (-sign * 300000 );
1771
1792
_mountStatus |= STATUS_SLEWING;
1772
1793
}
1773
1794
if (direction & WEST) {
1795
+ LOGV2 (DEBUG_STEPPERS, F (" STEP-startSlewing(W): initial targetMoveTo is %l" ), sign * 300000 );
1774
1796
_stepperRA->moveTo (sign * 300000 );
1775
1797
_mountStatus |= STATUS_SLEWING;
1776
1798
}
@@ -1907,7 +1929,8 @@ void Mount::loop() {
1907
1929
interruptLoop ();
1908
1930
#endif
1909
1931
1910
- #if DEBUG_LEVEL&DEBUG_MOUNT
1932
+ #if DEBUG_LEVEL & (DEBUG_MOUNT && DEBUG_VERBOSE)
1933
+ unsigned long now = millis ();
1911
1934
if (now - _lastMountPrint > 2000 ) {
1912
1935
Serial.println (getStatusString ());
1913
1936
_lastMountPrint = now;
@@ -1975,7 +1998,7 @@ void Mount::loop() {
1975
1998
_mountStatus &= ~(STATUS_SLEWING | STATUS_SLEWING_TO_TARGET);
1976
1999
1977
2000
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 ( ));
1979
2002
// Mount is at Target!
1980
2003
// If we we're parking, we just reached home. Clear the flag, reset the motors and stop tracking.
1981
2004
if (isParking ()) {
@@ -2129,6 +2152,16 @@ void Mount::clearDecLimitPosition(bool upper) {
2129
2152
}
2130
2153
}
2131
2154
2155
+ // ///////////////////////////////
2156
+ //
2157
+ // getDecLimitPositions
2158
+ //
2159
+ // ///////////////////////////////
2160
+ void Mount::getDecLimitPositions (long & lowerLimit, long & upperLimit) {
2161
+ lowerLimit = _decLowerLimit;
2162
+ upperLimit = _decUpperLimit;
2163
+ }
2164
+
2132
2165
// ///////////////////////////////
2133
2166
//
2134
2167
// setHome
@@ -2323,6 +2356,16 @@ void Mount::moveSteppersTo(float targetRA, float targetDEC) {
2323
2356
}
2324
2357
2325
2358
_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
+
2326
2369
_stepperDEC->moveTo (targetDEC);
2327
2370
}
2328
2371
0 commit comments