Shop OBEX P1 Docs P2 Docs Learn Events
Astrometric program — Parallax Forums

Astrometric program

Gerry ShandGerry Shand Posts: 45
edited 2009-10-15 18:05 in BASIC Stamp
Hello All:

Has anyone tried doing an astrometric system based on a BS-2?

I am looking at this and probably need a DS-1302, a co-processor, some pushbutton interfaces to set the time on the 1302, and a LCD display.

Any advice? I know this would be a pretty ambitious project and could piece it together over the next 8 - 12 months but if the wheel has already been invented ...

Thanks in advance for any assistance or advice.

Regards,

Gerry Shand

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-14 00:30
    For those of us not familiar with "astrometry" and/or too lazy to look it up, could you define the term vis-
  • Gerry ShandGerry Shand Posts: 45
    edited 2009-10-14 02:12
    Hi Phil:

    What I am trying to do is set up the Basic Stamp as a sunrise and sunset calculator for use as a portable device. You would enter the coordinates at your location in terms of latitude and longitude and then using the time clock to get the date, compute the sunrise and sunset time at that location.

    This portable device can also double as a sun tracker with some modifications to the code. The math is pretty straightforward using an Excel spreadsheet but there are enough sines, cosines, tangents and their inverses to require a math co-processor to make this work.

    Hopefully this clarifies things.

    Gerry
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-14 02:33
    Ah, so. Thanks. Do you own a copy of Jean Meeus' Astronomical Algorithms?

    -Phil
  • Gerry ShandGerry Shand Posts: 45
    edited 2009-10-14 03:41
    Phil:

    No, I do not have a copy of this but it looks interesting. Does his section on rising and setting boil out the complicated trig? If so, then that is a more elegant approach that would justify me purchasing this tome.

    Thanks and regards,

    Gerry
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-10-14 04:16
    The µM-FPU coprocessor could do the math rather smoothly. Since you can store complete algorithms in the coprocessor eeprom, the PBASIC side would come down to passing in the date and reading out the result. Ahh, I see Cam has posted app note 38, to wit:
    Describes how to calculate sunrise and sunset times. A set of uM-FPU V3.1 user-defined functions are provided to 
    implement the calculations and read date, time and position information from a GPS receiver.
    

    .
    Note that the µM-FPU goes one better on the location and time, as it has a serial input buffer that parses GPS strings easily into its internal variables.

    I did a much cruder sunrise /sunset algorithm on the BASIC Stamp sans coprocessor for stationary systems that needed the information for monitoring the flight of bats. It didn't need to be precise. I used the excellent spreadsheet macros in Greg Pelletier's twilight.xis to generate a DATA table for the Stamp, tied to a specific location +/- a few hundred miles.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 10/15/2009 6:11:54 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-14 06:45
    Gerry,

    I don't know the answer to your question. I have a different book of his, Astronomical Formulae for Calculators, and there's some trig involved.

    -Phil
  • Gerry ShandGerry Shand Posts: 45
    edited 2009-10-15 02:54
    Hi All:

    Thanks for the inputs and pointers as it looks like I have most of what I need for this piece of the puzzle. I also built a spreadsheet in Excel that utilizes the Sunrise/Sunset algorithms by the Nautical Almanac Office of the United States Naval Observatory to use as a cross check as well.

    Best regards,

    Gerry
  • achilles03achilles03 Posts: 247
    edited 2009-10-15 13:48
    I don't think you'd need a co-processor for this. With careful planning, I think you could do it with integer math. Storing variables like elevation and azimuth as word variables gives you a resolution of .0055 degrees! Do you plan on needing more resolution than that?

    Some of the calculations could be simplified ahead of time with look-up tables (say, stored in an eeprom), including trig functions (to a high degree of fidelity). This also follows the KISS philosophy, which I'm a big fan of. cool.gif

    Just some food for thought...

    Dave
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-10-15 18:05
    I'm attaching my twilight-bat-bs2 EXCEL spreadsheet that generates a PBASIC program to find sunrise and sunset times at a fixed latitude and longitude. It does this by table lookup and interpolation. You enter the latitude and longitude in the blanks, and the spreadsheet uses macros to calculate the sunrise and sunset times at 7 day intervals for a duration of 4 years starting on January 1st of the year that you enter. It formats those times into a BASIC Stamp DATA table along with a PBASIC subroutine that takes a date as input and returns the sunrise and sunset times in variables, as minute of day. The subroutine interpolates in the table to improve the accuracy.

    To use this, look at the EXCEL tab "sunRiseSetMaker.bpe. You copy the red text from the spreadsheet and paste it into the PBASIC IDE. The program is written for using cross-slot calls in a BS2pe, but if it is run by itself in any Stamp it defaults to a test program that asks on the debug screen for the user to enter a date and then shows the sun rise and set times. The other EXCEL tabs are Greg Pelletier's original twilight demos.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.