Arduino Based ASCOM Rotator

One to many cloudy nights has spurred me into action. My imaging setup is getting closer to automated but I’ve had a distinct missing link, the ability to choose a guide star from within my astronomy applications. Since adding the MOAG and updating my guide camera I’ve added a Takahashi CAA rotator and it provides excellent manual rotation.

The reason I selected the CAA was price and aperture. I did look longingly at a number of electronic rotators.

Automation of the rotation was another issue. There seems to be lots automation for mounts and focuses but nothing for rotators. Google was not my friend. So I decided to write something. This is very much a work in progress but so far I have adapted the code from the SGL Automation guys and attempted to make it rotator specific. It supports ASCOM v6.

The ASCOM interface for rotators is reasonably simple, Move, Position, etc and the ASCOM documentation and templates are excellent. Well done standards guys, shame us health professionals can’t get our act together as we’ll as you have.

First go was to get the basics operating: Arduino, USB to serial driver, stepper motor, easy driver motor controller a couple of belts and a pulley. Check out the photos below.

I’ve only tested it with Maximdl using my bench setup as yet, but it seems to work well.

The bench setup.


The arduino (note the resistor is for the reed switch, keep reading).

The reed switch and magnet.


Reed switch and magnet.


I was having trouble this weekend determine the number of steps to make 360 degrees so I dug up an old reed switch, found a very small magnet and introduced homing and a step counter into the software, as of Sunday night it all appears to work.

The Arduino Project and VB in the solution - ES - works but its still a little messy to release, but here you are anyway.

Code in action below

Sample rotator screen shots with debug



If you’ve been reading my blogs you will know that I’ve been struggling with tracking. It’s been months now and last night the problem finally became clear. I’m just a very slow learner.

My ST 402, is a great little guide camera, hanging off my MOAG I never fail to find a star. The problem was that I was getting pixel movements during guiding of up to 1.8 pixels in X and Y. Obviously the resulting images where poor. I was reading again about sampling and came across the old 2 arcsec per pixel rule. I run my FLI Proline 16803 at 2x binning to get a ratio of about 1.7 arcsec per pixel (as reported by Maxim). The ST 402 has pixels of 6.9 by 4.3 so the ratio when hanging off the back of my MOAG is about 0.36 (an average of the two dimensions). I changed the binning to 3×3 giving a ratio of about 1.1, and surprisingly the tracking variation is now reduced to a max of 0.4 pixels in either direction, average deviation is less than 0.15. The pictures look heaps better as well.

Now I have to go back and fix my auto focus, FocusMax is causing me grief.


26/01/2013 – I’ve worked out FocusMax and what a wonderful solution it is.  Perfect focus every time!  The trick is choosing a dim enough star (in my case around 7 is perfect) and following the instructions.  They one major factor in this was counting the circles on the profile where the line began to diverge from straight, to determine the Near Focus HDF.  After I got this right it worked like a charm.  See the pictures below.

New web server

I’ve just spent all day with my son migrating my web and MySQL server to a Pandaboard. It’s ARM based dual core 1.2 GHz, with 1G of RAM using 64G SD card for disk. Very low power consumption. Our VM stack with iSCSI back end is no more, they are all RasberryPi’s, less power again.

So far it seems to run really well.

Dew heater

My SCT fogs up most evenings. I’m a little reticent to use a hair dryer and not sufficiently rich to buy a proper dew heater, so I played around to make my own.

I dug out some nichrome wire, cut it to the length of the diameter of my scope (about 1m) and played around with voltages until I had a small increase in temperature (comfortably warm enough to hold onto with my fingers). It must only be a few degrees. Just be warned its VERY easy to fry you fingers so start with low voltages and work up.

I had a Jaycar kit MOSFET power supply hanging around, slight overkill I know. I dug up a relay I’d used for something else, added a DHT22, an LCD display along with an Arduino and behold!


The power supply is turned on by driving the relay. The Arduino code reads the DHT22 every 5 seconds, calculates the dew point temp, displays the current temp, the dew point temp and relative humidity. If the current temp is within 4 degrees of the dew point it turns on the power supply.

BTW the knob is only used to control the contrast on the LCD as it gets to bright when the scope is taking pictures.

Note the insulator on the nichrome as well. My scope conducts!


An now turned on


More experiments with collimation – an alternate approach

Can anyone tell me why this shouldn’t work? I brought a Hotech SCT collimator a week or so ago, I was sick of not being able to accurately collimate using the out of focus star method. The Hotech was quite easy to use but my final collimation was worse than before, just poor operator I suspect.

I started looking at 60 second shots and the stars were clearly badly collimated, the longer the exposure the worse the star looked, and it’s not the tracking. Out of sheer frustration I started taking 1 second exposures continuously and began twiddling the secondary mirror knobs. The star began to get smaller, and smaller and smaller and more evenly shaped. It ended up with a perfect circle at 400%. The star was out of focus, but not so much that it looked like a doughnut.

So next step run the autofocus routine, the star (it was mag 5) shrunk still more and was still perfectly shaped. Collimation fixed. Now when I’m on on either side of focus or in focus the star is a nice circle. Why can’t we do collimation this way all the time? It was nice and easy and produced a great result.

M16 v2


After ages away from the scope I had some time to snap M16 in a wider angle.   This is taken on my Tak FS 102 and QSI 583 WSG, in LRGB.

the 9 subs are 5 minutes each of LRGB at -12C, using Astronomik 2C LRBG filters.

Guiding using Maxim dl

See update below.

I’ve been trying for weeks to get guiding to work perfectly in Maxim DL. I’ve just upgraded to v5.22 in case it was a bug.

Here’s the scenario. I’ve recently added an 8 filter wheel extension to my QSI 583. I also added the guider port. I’ve attached my Orion autoguider (with lense) to act as an off axis guider. I’ve had real problems getting Maxim to calibrate the guider using the stars I’ve selected. With my combination I’ve found that with pixel intensities in the star of greater than about 160 then the little red L would appear reliably every time.

Over the last couple of nights nothing I did would get it to calibrate, even on the brightest stars. I tried replacing the USB cable (I was getting desperate), playing with the previously good settings but to no avail.

I went back to PHD and it worked first time on much fainter stars with the old cable. I know when I’m beaten PHD it is.

21/11/12 I’ve just acquired an ST-402 and got it working as a guider. Guess what all the problems experienced under Maxim dl guiding are gone. In short buy a better guide camera.

Temperature focus compensation FLI Atlas

My FLI Atlas is a lovely focuser however it does not have temperature compensation.  After many frustrating nights ducking out to fix my focus after one or two images I decided to do something about it.  Enter Maxim DL Scripting.

I figured I could read the temperature of the focuser store it in a file on disk and then at the end of the next image read the temperature again and compare it to the one I wrote to disk.  If the difference was substantial (i.e. some number in my case 0.2C) I could move the focuser an specific amount.  In my case for the LX 200 it measured up to be about 0.19mm per 1  C.

Maxim dl scripting is pretty straight forward except when it comes to the Focuser.  If you create the object directly you can end up with two instances of the focuser object so what I did was use the Generic Hub and pointed Maxim to this and the Hub I pointed to the FLI Focuser.  The code is setup accordingly.

I run it at the end of each image (configure under Autosave->Script).

Code attached as a vbs so it only works under windows.  Download it from here it’s only a few lines.


Finally a picture. M16 in Ha.

13x 15 min subs 2 days after full moon.

Taken using a set of Don Goldmans 3nm Ha filter, using an FLI Proline at -35 C on a 12″ LX 200.

FLI Filter Wheel

There’s always something new to learn. I just got a set of Astrodon’s LRGB Tru Balance E-Series filters. I installed them in my FLI CFW3-10. The mechanics of fitting them was very smooth. The different width locking nuts is very clever. When I installed the filters I did notice a position 0 on the wheel and thought nothing of it. I setup the filters in positions 1-4, LRGB respectively. I then fired up Maxim and configured the filter wheel. Positions 1-4. I then proceeded to take a short series of unguided 180 second shots of M20. The pictures were lovely but when I combined them I noticed that the stars in the luminance frame where enlarged. Why? yes you guessed it, it appears that the filter wheel positioning counts from 0 and Maxim counts from 1. Same position.

Never mind, next time.