Skip to content

Verification of accuracy #8

@LovatoTomas

Description

@LovatoTomas

Hi, I have several boards, but none that support true doubles. I modified my telescope with an Arduino to be a goto system, but many times it's even wrong by one degree. I wanted to understand if the reason is only the inaccuracy due to the float - double or if something else.
I would like to buy Arduino Giga (arm m7 with double support) but first I would like to ask you if you can run the code of example 3 (slightly modified) with these parameters (coordinates of Jupiter on the indicated datetime/location):

#include <SiderealPlanets.h>

// Need the following define for SAMD processors
#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)
#define Serial SERIAL_PORT_USBVIRTUAL
#endif

SiderealPlanets myAstro;

void setup() {
Serial.begin(9600);
delay(2000); //SAMD boards may need a long time to init SerialUSB
Serial.println("Sidereal Planets Coordinate Conversion Functions");
myAstro.begin();
Serial.println("\nBecause these conversions are dependent on both time and location,");
Serial.println("those values have to be set first.");
myAstro.rejectDST();
myAstro.setTimeZone(-3);
myAstro.setLatLong(myAstro.decimalDegrees(46,55,0), myAstro.decimalDegrees(31,0,0));
myAstro.setGMTdate(2023,7,30);
myAstro.setLocalTime(23,0,0);
Serial.print("Latitude: ");
myAstro.printDegMinSecs(myAstro.getLatitude());
Serial.println("");
Serial.print("Longitude: ");
myAstro.printDegMinSecs(myAstro.getLongitude());
Serial.println("");

Serial.println("Now convert RA/Declination to Azimuth/Altitude coordinates");

myAstro.setRAdec(myAstro.decimalDegrees(2,46,2.7), myAstro.decimalDegrees(14,45,32.5));
Serial.print("Right Ascension ==> ");
myAstro.printDegMinSecs(myAstro.getRAdec());
Serial.println("");
Serial.print("Declination ==> ");
myAstro.printDegMinSecs(myAstro.getDeclinationDec());
Serial.println();
myAstro.doRAdec2AltAz();

Serial.println("And the Results are:");
Serial.print("Azimuth==> ");
myAstro.printDegMinSecs(myAstro.getAzimuth());
Serial.println("");
Serial.print("Altitude==> ");
myAstro.printDegMinSecs(myAstro.getAltitude());
Serial.println("\n");

Serial.println("And we can take the Azimuth/Altitude, and compute RA/Dec:");
myAstro.doAltAz2RAdec();
Serial.print("Right Ascension ==> ");
myAstro.printDegMinSecs(myAstro.getRAdec());
Serial.println("");
Serial.print("Declination ==> ");
myAstro.printDegMinSecs(myAstro.getDeclinationDec());
Serial.println();
}

void loop() {
while(1); //Freeze
}

My results are:

Sidereal Planets Coordinate Conversion Functions
Because these conversions are dependent on both time and location,
those values have to be set first.
Latitude: 46:55:0.00
Longitude: 31:0:0.00
Now convert RA/Declination to Azimuth/Altitude coordinates
Right Ascension ==> 2:46:2.70
Declination ==> 14:45:32.50
And the Results are:
Azimuth==> 128:23:54.00
Altitude==> 47:42:23.84
And we can take the Azimuth/Altitude, and compute RA/Dec:
Right Ascension ==> 2:46:2.69
Declination ==> 14:45:32.49

But the results should be (only AltAz is wrong):

Sidereal Planets Coordinate Conversion Functions
Because these conversions are dependent on both time and location,
those values have to be set first.
Latitude: 46:55:0.00
Longitude: 31:0:0.00
Now convert RA/Declination to Azimuth/Altitude coordinates
Right Ascension ==> 2:46:2.70
Declination ==> 14:45:32.50
And the Results are:
Azimuth==> 129:34:14.60
Altitude==> 48:13:20.50
And we can take the Azimuth/Altitude, and compute RA/Dec:
Right Ascension ==> 2:46:2.69
Declination ==> 14:45:32.49

I need a correct AltAz- RAdec conversion and vice versa because my telescope has an altazimuth mount while stellarium (with the lx200 protocol) works with RAdec.
If you can run this code with a board that supports real doubles and give me feedback, you'd be doing me a huge favor.
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions