summaryrefslogtreecommitdiffstats
path: root/indi-celestronaux/celestronaux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indi-celestronaux/celestronaux.cpp')
-rw-r--r--indi-celestronaux/celestronaux.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/indi-celestronaux/celestronaux.cpp b/indi-celestronaux/celestronaux.cpp
index ad8afe9..907375b 100644
--- a/indi-celestronaux/celestronaux.cpp
+++ b/indi-celestronaux/celestronaux.cpp
@@ -1674,8 +1674,11 @@ uint32_t CelestronAUX::HoursToEncoders(double hour)
/////////////////////////////////////////////////////////////////////////////////////
void CelestronAUX::EncodersToRADE(INDI::IEquatorialCoordinates &coords, TelescopePierSide &pierSide)
{
- auto haEncoder = (EncoderNP[AXIS_RA].getValue() / STEPS_PER_REVOLUTION) * 360.0;
- auto deEncoder = 360.0 - (EncoderNP[AXIS_DE].getValue() / STEPS_PER_REVOLUTION) * 360.0;
+ auto haEncoder = -90. + (EncoderNP[AXIS_RA].getValue() / STEPS_PER_REVOLUTION) * 360.0;
+ auto deEncoder = 90. - (EncoderNP[AXIS_DE].getValue() / STEPS_PER_REVOLUTION) * 360.0;
+
+ haEncoder=range360(haEncoder);
+ deEncoder=range360(deEncoder + 180.) - 180.;
double de = 0, ha = 0;
// Northern Hemisphere
@@ -1820,8 +1823,8 @@ void CelestronAUX::RADEToEncoders(const INDI::IEquatorialCoordinates &coords, ui
}
}
- haEncoder = (range360(ha) / 360.0) * STEPS_PER_REVOLUTION;
- deEncoder = (360.0 - range360(de)) / 360.0 * STEPS_PER_REVOLUTION;
+ haEncoder = (range360(90. + ha) / 360.0) * STEPS_PER_REVOLUTION;
+ deEncoder = (range360(90. - de)) / 360.0 * STEPS_PER_REVOLUTION;
}
/////////////////////////////////////////////////////////////////////////////////////