Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/Declination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,9 @@ Declination Declination::ParseFromMeade(String const &s)

Declination Declination::FromSeconds(long seconds)
{
const auto secondsFloat = static_cast<float>(seconds);
const auto arcSecondsPerHemisphereFloat = static_cast<float>(arcSecondsPerHemisphere);
if (inNorthernHemisphere)
{
return Declination(((arcSecondsPerHemisphereFloat / 2.0f) - secondsFloat) / 3600.0f);
}
return Declination(((arcSecondsPerHemisphereFloat / 2.0f) + secondsFloat) / 3600.0f);
// Celestial seconds to axis: use the same conversion as the Meade wire path, so the LCD POI menu and :XGC
// land on the same side of the pole as a Meade goto in both hemispheres.
return fromCelestialSeconds(seconds);
}

const char *Declination::formatString(char *targetBuffer, const char *format, long *) const
Expand Down
14 changes: 7 additions & 7 deletions src/Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2696,8 +2696,8 @@ void Mount::startSlewing(int direction)
}
else
{
// Start slewing
int sign = inNorthernHemisphere ? 1 : -1;
// Start slewing. No hemisphere sign here: RA stepper space is the same in both hemispheres (the RA DIR pin
// is inverted for the south in configureHemisphere()), so WEST is always positive, like gotos and tracking.

// Set move rate to last commanded slew rate
setSlewRate(_moveRate);
Expand Down Expand Up @@ -2780,9 +2780,9 @@ void Mount::startSlewing(int direction)
long targetEastPos = _stepsPerRADegree * 15.0 * (RA_PHYSICAL_LIMIT + trackedHours);
LOG(DEBUG_STEPPERS,
"[STEPPERS]: startSlewing(E): initial targetMoveTo is %l (adjusted for %fh tracked)",
-sign * targetEastPos,
-targetEastPos,
trackedHours);
_stepperRA->moveTo(-sign * targetEastPos);
_stepperRA->moveTo(-targetEastPos);
setStatusFlag(STATUS_SLEWING);
}
if (direction & WEST)
Expand All @@ -2791,9 +2791,9 @@ void Mount::startSlewing(int direction)
long targetWestPos = _stepsPerRADegree * 15.0 * (min(RA_PHYSICAL_LIMIT, RA_TRACKING_LIMIT) - trackedHours);
LOG(DEBUG_STEPPERS,
"[STEPPERS]: startSlewing(W): initial targetMoveTo is %l (adjusted for %fh tracked)",
sign * targetWestPos,
targetWestPos,
trackedHours);
_stepperRA->moveTo(sign * targetWestPos);
_stepperRA->moveTo(targetWestPos);
setStatusFlag(STATUS_SLEWING);
}
}
Expand Down Expand Up @@ -4618,7 +4618,7 @@ float Mount::checkRALimit()
const float homeRA = zeroRA + trackedHours;
LOG(DEBUG_MOUNT_VERBOSE, "[MOUNT]: checkRALimit: homeRA: %f (ZeroPos: %f + TrkHrs: %f)", homeRA, zeroRA, trackedHours);
LOG(DEBUG_MOUNT_VERBOSE, "[MOUNT]: checkRALimit: degreePosDec: %f , RA hourpos : %f)", degreePos, hourPos);
if (inNorthernHemisphere ? degreePos < 0 : degreePos > 0)
if (degreePos < 0)
{
hourPos -= 12;
if (hourPos < 0)
Expand Down