Shop OBEX P1 Docs P2 Docs Learn Events
clock drive for a telescope — Parallax Forums

clock drive for a telescope

scott99scott99 Posts: 14
edited 2010-03-25 15:17 in BASIC Stamp
Hi, My name is Scott, building a clock drive for a telescope. I want to use the bs2 for my frequency controller (using a synchronous drive motor). The program works for the proper sidereal speed but·I need to add a different frequency for lunar tracking.

' {$STAMP BS2}
' {$PBASIC 2.5}

DEBUG "tone sending"
DO

FREQOUT 12, 60000*10000, 1193

LOOP

How do I write the program to have a push button switch to a different frequency output, either on the same pin or a different one?

Desperate in Chicago,
Scott

Post Edited By Moderator (Joshua Donelson (Parallax)) : 3/22/2010 10:05:14 PM GMT

Comments

  • DynamoBenDynamoBen Posts: 366
    edited 2010-03-22 18:54
    BTW this is the prop section of the forum and you don't have a subject.
  • scott99scott99 Posts: 14
    edited 2010-03-22 19:02
    Opps sorry. I did notice that after the post and reposted on bs2. Thanks.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-23 14:11
    Hmmmm, I think this would be a lot easier if you use a toggle PB to select speed. The reason is while the BS2 is busy sending clock pulses, it probably won't see you press a momentary pushbutton.

    Also, I play with astro-photography a bit as well. Either you'll want to use an extremely long time base for your freqout command which would make and human interface (pushbuttons) or display readouts annoying....... or you'd want to be very careful with your program and count all execution times. What I mean is:


    Prog1:
    ' Long time base as possible
    ' sends freq to pin 12 for 65.5 seconds on a BS2
    ' the execution for the "goto main" will give you an accumulated error
    ' but the percentage in this case is minimal.... looses a minimal amount of time every 65.5s

    main:
    FREQOUT 12,65535, 1193
    goto main




    Prog1:
    ' Short time base to do other things as well
    ' sends freq to pin 12 for 0.1 seconds on a BS2
    ' the "other stuff" will give you a higher percentage accumulated error
    ' so every 100ms you check the buttons and update the display
    ' both of which take time, while your clock drive is busy doing nothing

    main:
    FREQOUT 12,100, 1193
    gosub check_buttons
    gusub update_display
    goto main



    Your best bet I think would be a two position switch for frequency. Then the program starts, run the current frequency associated with the switch forever. If you need to change speed you'd change the switch, then reset the BS2. Then it'd run the new speed forever.

    Either that or you'd have to be very carful to fit the "other stuff" between the drive pulses.

    Parallax has a motor controller too. You send it a command and it does it, while your BS2 handles the buttons, displays, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-23 14:15
    Another thing could be use a 555 timer and maybe a digital resistor IC. You'd change the resistor with the BS2 to change the 555 frequency. It might not be as adjustable as you'd need though.


    Are you doing photography or just visual???? I suppose I should have asked that first. Visual won't need to be NEAR as accurate as photography.

    If you're taking images, what is your expected exposure time?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • scott99scott99 Posts: 14
    edited 2010-03-23 14:35
    Thanks, Spiral_72

    I think you nailed it with the toggel switch and new pin out put. I will give that a try.
    Thank you,
    Scott
  • Rob7Rob7 Posts: 275
    edited 2010-03-23 14:57
    Hi Scott, and welcome to the forum !
    I like the idea of a clock drive.
    Last year I up-graded from a 4.5 Mead reflector and was contemplating building a drive unit for it, until Christmas when I could not hold back and make the up-grade !
    Interesting project. Please post your progress and have fun with it.
    Here is a pic of my current set-up.
    1. A Celestron CPC 1100 GPS XLT
    2. Just experimenting with my scope and believe it or not I took this photo through my Iphone in Feb.

    Post Edited (Rob7) : 3/23/2010 3:04:58 PM GMT
    1552 x 1164 - 124K
  • scott99scott99 Posts: 14
    edited 2010-03-23 15:13
    Hey Rob7,
    Thanks for the pic's. Looks like your in the South West.

    This telescope project has been on going from 1973. I vividly recall riding my bike home for the American Science center store in Chicago IL when I was 17. Shelved the project for a while and finished it in 1977.
    Have been rebuilding the mounts and housings ever since. Most people can't understand but its one of those things that can help save your mind from insanity throughout the years. Reflector 8" F4.5

    Scott
  • Rob7Rob7 Posts: 275
    edited 2010-03-23 16:08
    Scott,
    I am in So. Cal near San Diego and live 30 min from the Palomar Observatory.
    My Mead 4.5 inch reflector was bestowed to me as a gift in 1997 and I have had many great years with that scope. It took about 45 minutes to and hour to set up, tracking was all manual and tough to do when I started to take photo's with it, however I loved every minute with it. I opted to upgrade instead of building all the hardware I needed and the scope was donated to the college students at Palomar College studying in Astronomy.
    The skies here are becoming brighter each year and with what I have now, I do not think I will need anything larger.
    Scott, do you have pics of your progress in the web. I would like to see it ?
    You can send me a P.M. with the link.
    Good luck on completing your project.
    Robbie

    Post Edited (Rob7) : 3/23/2010 4:21:49 PM GMT
  • scott99scott99 Posts: 14
    edited 2010-03-23 16:19
    What is your E-mail?
  • Rob7Rob7 Posts: 275
    edited 2010-03-23 16:20
    Scott,


    emu81008@yahoo.com

    Post Edited (Rob7) : 3/23/2010 6:28:01 PM GMT
  • scott99scott99 Posts: 14
    edited 2010-03-23 16:25
    benchpress315x7@aol.com
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-23 19:00
    Someone correct if I'm wrong, but the largest value that can be used for the duration in FREQOUT is a word sized value, or 65535..... Right?


    Referring to: FREQOUT 12, 60000*10000, 1193

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • scott99scott99 Posts: 14
    edited 2010-03-23 19:04
    yes that *10000 did nothing. just left it in.
  • scott99scott99 Posts: 14
    edited 2010-03-23 19:12
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    DEBUG "tone sending"

    main:
    FREQOUT 12,65535, 1193
    goto main

    main:
    FREQOUT 12,100, 1193
    gosub check_buttons
    gusub update_display
    goto main

    What am I missing? this is such new tech for me. stuck in 1980 with old fashon IC's.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-24 16:05
    OH, no..... the code I typed was for an example only. I was illustrating that you might have some subroutines to check the button states (gosub check_buttons) and a subroutine to display stuff on the screen (gosub update_display)

    The first part should work though.


    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    DEBUG "tone sending"

    main: ' A label or landmark if you will
    FREQOUT 12,65535, 1193 ' oscillate pin 12 at 1193 hertz for 65535 milliseconds
    goto main ' Jump to (go to) the label "main"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-24 16:08
    Ah, Smile. It ruined my formatting.

    Everything to the right of the apostrophes are comments.

    Just enter this:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    DEBUG "tone sending"

    main:
    FREQOUT 12,65535, 1193
    goto main

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • FranklinFranklin Posts: 4,747
    edited 2010-03-24 17:24
    Spiral, if you use·the "code"·brackets·it will preserve your formatting. Or you can use the post reply and use the code icon.

    Like
    'Code goes here
        and here
    

    
    

    P.S. it works best if you paste your code in

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen

    Post Edited (Franklin) : 3/24/2010 5:30:09 PM GMT
  • scott99scott99 Posts: 14
    edited 2010-03-24 18:12
    I ran that. Thanks. It works perfect. I just need some how to tell it to run at a different frequencies on another pin. Even if the bs2 needs to be reset. It seems like the program you have me is a steady rock solid tone output. but when I try to include another pin out with a new frequency, there is a slight momentary pulse of interruption of what ever pin out is producing, and that pulse comes up on the duration periods.
    Is there any way to increase that duration to forever? I have no problem with a reset to change frequency.
    Here is what I use now but get an annoying pulsed interruption every 60 seconds.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    DO
    DEBUG ? IN4
    DEBUG ? IN3
    IF (IN3 = 1) THEN
    FREQOUT 14, 60000, 250
    ENDIF

    IF (IN4 = 1) THEN
    FREQOUT 15, 60000, 200
    ELSE



    ENDIF


    LOOP
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-25 13:26
    You cannot have a tone forever using the FREQOUT command. You're limited to 65.5s..... I suppose you COULD write your own code to do the same thing as FREQOUT, but that'd be silly.

    Yup, all instructions take time. That's why there's a "burp" between FREQOUT commands.

    I'd do something like this, where you check the switch FIRST! and set a frequency variable according to the switch state.... Then you run that previously set frequency, for 65.5s repeated forever.

    You'll probably still get a little "blip" every time through the loop, but I seriously doubt it'll ever cause a problem. If I'm wrong, I'll help you write a SCOTT'S FREQOUT ROUTINE [noparse]:)[/noparse]

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    FREQ1    CON   1000
    FREQ2    CON   1500
    F            VAR   WORD
    
    main:
    IF IN3=1 THEN F = FREQ1
    IF IN4=1 THEN F = FREQ2
    
    forever:
    FREQOUT 14, 65535, F
    goto forever
    
    




    Thanks Franklin for the info!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-25 13:29
    Hmmmm, my code formatting is still a little askew, but MUCH better.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • scott99scott99 Posts: 14
    edited 2010-03-25 14:52
    Hey Spiral_72,

    Your a genius! Thank you so much. If I can return the favor in some was please ask. I have a Precision Sheet metal fabrication co. And work as a trainer for amateur MMA fighters. Anything I in those fields I would be glad to return some help.

    Thanks again,
    Scott
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-25 15:02
    Ah, glad I could help guy. Enjoy it.

    Post a image of M42 with your new clock drive if you can get it setup. Have fun!


    another thought come to mind too: make sure you tie the inputs to 0V through a 10k resistor.... then pull them HIGH with the switches. If not, the inputs will "float" (0,1,0,0,1,1,0,1 etc...) and it's possible it'll read the switches incorrectly an run the wrong frequency....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • scott99scott99 Posts: 14
    edited 2010-03-25 15:13
    yes thought that too. thanks
  • scott99scott99 Posts: 14
    edited 2010-03-25 15:17
    The program has just been saved in my basic stamp editor. Its official file name saved as, Spiral_72.
Sign In or Register to comment.