Wednesday, January 11, 2012

Arduino Bluetooth Digital Setting Circles for Telescope

I decided to build an Arduino digital setting circle for my mount because it's really hard to buy Tangent Instruments boxes cheaply, and the Argo Navis (the Lexus of telescope digital setting circles) is quite expensive. Besides it seemed like a cool project.

I used an Arduino Uno, which cost $32 (Singapore dollars)



an Arduino Proto Shield ($5), as well as some headers ($2)



I got an RJ-45 jack from Sim Lim Tower and soldered it to the Proto Shield. Obviously four (4) digital pins from the Arduino are needed to read the two encoder channels. A lesson painfully learned: do not use pins 0 and 1 (the serial RX and TX pins) for anything else!





Jim's Mobile (JMI) has some good documentation on the pinout of the RJ-45 encoder connector. By maintaining compatibility with the JMI/Tangent Instruments encoder cable, I ensured that my Arduino DSC is compatible with all the telescope encoder setups out there.

I used Mike Fulbright's Arduino DSC source code, although his code didn't implement 4X quadrature decoding, only 2X which results in half the encoder resolution.

In order to get 4X quadrature, you need to hook interrupts to both channels of the encoder. Since there are two encoders (RA and DEC), you need four (4) interrupts - but the basic Atmega328p CPU on the Arduino only has two interrupts. To get my four interrupts, I used the PinChangeInt library, which provides multiple virtual interrupts.

A side-effect of this choice of library is that my code won't compile on the Digilent Max32 which is a 32-bit Arduino-compatible board. I had bought this board because I wanted to make a full GoTo controller and thought I needed more RAM (the Arduino Uno only has 2K of RAM and an 8-bit processor, the Max32 has 512K of RAM and a 32-bit processor).

I also soldered a $9.95 "linvor" Bluetooth serial adapter from ebay to the Arduino proto shield and (breaking my earlier rule) wired the Bluetooth RX to the Arduino TX pin, and the Bluetooth TX to the Arduino RX pin.





A good overview of how to use these cheap Bluetooth dongles with the Arduino is here. Note that it is necessary to disconnect the proto shield from the Arduino Uno board when uploading code to the board, since the programming circuit and the Bluetooth board fight each other for control of the Arduino's serial pins (pins 0 and 1).

I then powered the Arduino DSC from a 12V supply and connected it to the RA and DEC encoders on my mount:



Actually I also put a DFRobot LCD Keypad Shield on it so I could eyeball the RA and DEC encoder readings. Although for the "production" version this is completely unnecessary because the encoder counts are polled by a PC.



Pairing the "linvor" Bluetooth dongle with the PC is trivial and beyond the scope of this article, but suffice it to say that the Arduino DSC was accessible on COM4 on my PC. I was able to verify its operation using Putty (RealTerm didn't work and persistently disconnected the Bluetooth connection, avoid!)

I used Dave Ek's ASCOM driver for digital setting circles and Cartes du Ciel planetarium software.



Basically, you configure Cartes du Ciel (or any Windows planetarium software that supports ASCOM) to connect to the telescope, select the Dave Ek ASCOM driver, select COM4 (or whatever COM port the Arduino DSC gets assigned by the Bluetooth subsystem) and align.

After a successful alignment, when you move the telescope mount around and the encoders change readings, Cartes du Ciel will update its on-screen reticle to correctly reflect where the telescope is pointing. Cool!

This DSC should also work with SkySafari for Android which supports Tangent Instruments-type encoders over Bluetooth. I'll test this out when I get my hands on an Android 2.2 device.

The nice thing about this DSC (as compared to say Dave Ek's DSC circuit) is that the amount of soldering and PCB-etching required is close to nil: all you need is an RJ-45 jack, the Bluetooth dongle, an Arduino Uno, a Proto Shield, and the headers.

The Arduino Uno at about $25 USD is so darn cheap that it doesn't make sense to knock yourself out etching your own PCB and soldering tiny parts to it. This DSC does require some soldering - the RJ-45 jack, headers, and Bluetooth dongle - but that's quite minimal. And the total cost is well under $100, under $50 even. Most folks want $150 plus for their old Tangent Instruments boxes, so as long as you have a laptop already or Android device, you're golden. And I always have a laptop with my mount anyway, since I use the laptop for image capture and guiding.

Wednesday, December 28, 2011

Poor Man's Vixen Starbook

Here is how I butchered a NGC Sky Vector Digital Setting Circle (DSC) to connect it to a SkyWire.

SkySafari from Southern Stars is a great planetarium application for the Apple devices and now Android. It's the closest to the old Starry Night Backyard that I knew and loved a decade ago.

One of the neat tricks that SkySafari has is its ability to control most any telescope via a wireless dongle called a SkyFi, or a cheaper wired serial dongle called a SkyWire:



The SkyWire is basically a serial port that connects to the port on the bottom of every iPod, iPhone, and iPad out there.

I had already previously used the SkyWire to control my Celestron CGEM mount, but the CGEM is currently in the doghouse because its GoTo's are darn unreliable. I already had an NGC Sky Vector that I snagged for a hundred bucks off Astromart. The Sky Vector has an RJ-11 jack for a serial connector to a PC (or SkyWire) but I didn't have an RJ-11 plug (or crimper) handy. I did however have a DB-9 female connector, so I decided to swiss-cheese the Sky Vector casing.

Before:


After two runs with a 6mm drill bit:


And much later after much dremel-ing:




The Sky Vector PCB (note the little Tangent Instruments label) with its vacuum-fluorescent display and minimalistic four-button interface:



Contrary to my belief (which caused a lot of head-scratching and gnashing of teeth) the RJ-11 jack is soldered to both sides of the PCB, and the correct pins to solder to.. are not obvious. Only three wires are needed: RX, TX, and GND. And I got them all wrong.

The correct pinout according to Southern Stars. Use the third column ("Southern Stars SkyFi") and fifth column ("Celestron, Astromaster, others").

So basically it's DB9 pin 3 to RJ-11 pin 3; DB-9 pin 5 to RJ-11 pin 4 (this is the ground pin); and DB-9 pin 2 to RJ-11 pin 2. More information albeit with not as nice-looking diagrams.

After several bouts of soldering:


Buttoned it up..


and in action (telescope mount not shown):


I noticed that SkySafari couldn't talk to the Sky Vector initially (although I could using a USB serial adapter and RealTerm which is a good HyperTerminal replacement). Turns out my V 3.65 Sky Vector doesn't respond to queries about its maximum encoder resolution, I had to hard-code these into SkySafari.

Next stop.. real alignment. Weather's pretty bad so I just did a simulated/fake align to verify operation.

The nice thing about SkySafari is that you can sync on anything on the screen. Doesn't have to be from a small list of alignment stars.

Sunday, December 18, 2011

Wood Low-Latitude Wedge for AP600E

The Astro-Physics 600E equatorial mount is not designed to go as low as 1 degree Latitude, where I live. Unfortunately the 900WDGA low-latitude wedge for the AP900 is not compatible with the AP600, and the successor to the AP600E (the Mach1 GTO) doesn't need a wedge to reach low latitudes.

I had a company in Malaysia fabricate a low-latitude wedge for my CGEM, but as I am not traveling to Malaysia anytime soon, I could not get one made for my AP600. Instead, I decided to make one myself out of wood.

The parts were a shelf board from Home-Fix DIY Shop (S$11) and two 8" diameter wood chopping boards from Carrefour (S$7.50 each). I cut a couple of angled pieces from the shelf board, sanded them down to get them flat and consistent, then glued them to one of the chopping boards. I also put a flat piece in-between the angled pieces for strength.



After attaching the top chopping board (also with epoxy) I drilled three holes 120 degrees apart and screwed M6 threaded inserts into the holes.



This allowed me to use hex-head M6 bolts to attach the ADATRI to the top of the wedge.



Another view:



This is what it looks like in action:





The setup is still shaky, but I don't know if it's my wedge, or the aluminum surveyor tripod. I'm planning to purchase a Takahashi SE-S wood tripod locally although haven't gotten around to it. Hopefully that tripod in conjunction with my wooden wedge, will be stable enough.

Tuesday, December 06, 2011

How to take a proper flat

Flats are necessary to eliminate vignetting and dust spots on your camera or CCD sensor when doing astrophotography.

I wrote an entire essay all about flats for my Swinburne astronomy course, but that's neither here nor there.

Here's a primitive but fairly effective way of getting a "dome flat."

All you need is your entire imaging train (telescope, flattener and filters if required, and CCD camera or DSLR), a sheet of white paper, and your friendly laptop.

The key things to remember are:

1. The telescope must be right up against the laptop screen (which should be displaying a blank white page, like a blank PowerPoint slide)

2. You should put a sheet of paper against the laptop screen to diffuse the light a bit

3. The CCD integration time (exposure time) must be more than 2 seconds. The reason for this is that at short integration times, all sorts of weird visual artifacts show up on the laptop screen, kind of like the "rolling picture" of old-time TV's when you see them in movies

4. Take at least four flats, rotating the entire telescope by 90 degrees between flats. Your software (I use DeepSkyStacker) should average these four flats to create a master flat.

A picture is worth a thousand words:

Tuesday, November 22, 2011

Mount Periodic Error

I finally learned how to correctly measure periodic error of German Equatorial Mounts.

Some of the things I've learned: you need to turn off guiding output in PHD, otherwise what you are measuring is the error with auto-guiding turned on. And, you need to correct for the declination of the star you are guiding on (stars closer to the poles would show less periodic error as they move through shorter "arcs").

I've also learned how to use WebCamScheinern for somewhat automated drift polar alignment, and managed to get good alignments these past two weeks. And, I've also learned to use PEMPro (albeit a trial version for now) to measure periodic error and generate the curves.

With that said, here are the periodic errors of the three mounts I currently own. The Vixen Polaris is gone, sold to a guy in Manila, and I wouldn't bother measuring the periodic error of the Orion EQ-1 that's rusting under the sink.

Vixen Great Polaris with DD-1 stepper motor controller and two MT-1 steppers:



That's a whopping 85 arc-seconds peak-to-peak! a far cry from the 20 arc-seconds I wishfully "measured" some months ago..

Celestron CGEM:



29 arc-seconds peak-to-peak. Not too shabby, and smooth enough.

Astro-Physics 600E QMD, probably manufactured when I was still at university:



7.84 arc-seconds peak-to-peak. A pretty good figure, although I believe the G11 can match or exceed this performance (a used G11 would also cost a bit less, and crucially, carry much more payload). I'm trying to upload the PEM curve to this mount and see how low that figure can go..