From 20149a6f981444d364f7ee7543efb62c470a1d0d Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 1 Dec 2022 10:15:57 +0000 Subject: fix coord transforms for equatorial mounts --- indi-celestronaux/celestronaux.cpp | 11 +++++++---- 1 file 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; } ///////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3