Autofocuser development

Astrophotograhpy is a wonderful hobby and combines my passion for discovering the depths of the universe with passion for computers and writing software in particular. With 2 small children I am very limited with time, so optimization has been a number one priority in last 2 years since our daughter was born. First step was a simple shed to eliminate setting up mount, polar aligning and connecting everything from scratch every time. Second step was permanent PC next to the mount (controlled via RDP), which eliminates taking laptop outside and leaving it there for the night. That already saved me a lot of time, but was far from optimal. I still had to go out for initial focusing and later in the night refocusing due to focus shift, not to mention the meridian flip. With the stretch of bad weather we got at the end of 2017 and my ASI1600MM being serviced due to disconnecting issues (topic for another time), I decided to invest into autofocuser and configure meridian flip.

Prototype

Autofocuser is basically a stepper motor, which turns the focusing knob and is controlled with software running on your computer. New autofocuser unit costs a few hundred €, so I decided to try making my own and write an ASCOM driver for it. There are lots of wonderful tutorials for controlling the stepper motor via Arduino, but I won't get into that at the moment. First thing first – getting the components for first prototype.

  • NEMA14 stepper motor
  • A4988 stepper driver
  • Arduino Nano
  • 100uF capacitor

Caution: before conecting the motor to power, set current limiting according to stepper driver specs with on-board potentiometer (current limiting section).

Now let's get things moving! Arduino Nano controls the stepper motor driver via digital pins D2-D7. I have written sample program, which changes the step size and moves it to specified position, stored in eeprom (short video)


ASCOM driver

Next step was coming up with a simple set of commands, so we can control the motor via serial communication (UART via USB) from the ASCOM driver. For reference I used ASCOM documentation. After manual test of the commands and focuser behavior, I have written the ASCOM driver and tested it via ASCOM Conform test.


DRV8825 stepper driver

Proof of concept passed the test, but A4988 driver has issues with floating pins, so I had to pull down the STEP pin with a 10k resistor. After a quick search I found out DRV8825 already has built in internal pulldown and is quieter than A4988, so I ordered a few for test – they work great.


From protoboard to circuit

Now it was time to move from protoboard to the circuit. This was actually most challenging part for me, because I was quite new at soldering. I tried to layout the components so the circuit was as compact as possible and minimal soldering would be required.



Enclosure

My first though was some kind of fusebox from electronics shop with holes drilled for stepper motor and ports. I also asked for or help on Facebook ASCOM group. Guys were really helpful and had many awesome suggestions: fuse box, LEGOs, 3D printing,…

Nowdays the quality of budget friendly 3D printers has improved a lot, so I decided to buy my own 3D printer – Anycubic I3 MEGA. It took me a few days to get a grip on basic 3D modeling and this was the first version of enclosure:


Mounting

Next step was mounting it to my telescopes: WO Star 71mm f/4.9 and Skywatcher 200P. After some brainstorming I decided for belt driven solution. I mounted the box via Pololu Nema 14 L bracket and custom 3D printed mounting plate (which acts great as a belt tensioner). For proof of concept I also 3D printed the MXL pulley and clamped the belt from 2 shorter belts to get the correct length (short video).


First field test

With a few clear nights ahead it was time for first field test with WO Star 71mm f/4.9 on Pleiades. For control software I used SGPro. After some parameters tweaking first test session was on the way. Refocusing was done every 30min. Graph curve was a nice V curve with occasional hicups on the right side of the curve (more on that later). Beside that autofocuser worked flawlesly in the first field test throughout the whole night.



Enters Deep Sky Dad Autofocuser!

This is where I decided to make a batch of units and try to sell a few – and so Deep Sky Dad autofocuser was born! First things was making the box smaller, so I went back to the drawing board and came up with more compact version for the first batch.

First batch went to my colleague astrophotographers. Soon I was getting a lot of good ideas and useful feedback from all over ther world – Slovenia, Canada, Turkey, Australia...


Second field test

Second field test was on California emission nebula. I had to get to the bottom of the glitch on the right side of the V curve, which took me 3 evenings. It turns out that the focuser of my WO OTA has some minor play, which is especially obvious on the knob turn direction change – and that is exactly what happens on the right side of the curve. SGPro first goes away from the current focus position (to the farmost point on the graph). Than it starts backtracking step by step. On the first step, knob turning direction is actually reversed and focuser play causes stars to be slightly enlongated. This throws off SGPro smart focus alghoritm and sends the motor even further right – away from the focus. I discuessed the issue with SGPro authors and came up with the »Settle buffer« setting. Basically, the Arduino reports that focuser is still moving for the specified amount of time even after it has already stopped. Problem solved! The resulting image is a combination of my RGB data and phenomenal Ha data by my colleague from Canada



Lite enclosure

After some more feedback from my colleagues, I decided to make the box even more compact for the next batch. New enclosure is really minimal, with no Lid screws and is barely any bigger than the stepper motor itself. Additionally I switched from PLA filament to PET-G filament, which will improve the box sturdiness.


Stay tuned for more and check out the project on GitHub.


Disclaimer: Use this document at your own risk. We are not responsible for any issues that may arise from developing your own product by following our procedure.