Some Thoughts on Automation, and My Build of a Homebrew Stepper-Motor Auto-Focuser

In the latter part of 2018, I got to the point where I wanted to up my imaging game.  The main way I could do this was more data (i.e. more sub-frame exposures = more to stack = a better image to start with).  During the course of the previous 8 months or so, I’d already taken the leap from DSLR imaging to mono CCD-based capture using an ATIK 314L.  This was a revelation.  It was, however, a revelation that came with its own additional challenges.  The first of these was the main reason I’d avoided the jump to mono, and that was the necessary introduction of filters into my setup.  Unless you want to capture exclusively in visible light mono, or ‘Luminance’ as it’s called, then you need to use a range of different filters in your imaging train to enable you to capture the various wavelengths of light, which are then re-combined in post-processing to make up the image.  This means changing filters during the capture session.

ZWO EFW in my Imaging Train

I soon discovered this is an absolute pain if you don’t have a filter wheel.  A filter wheel goes between the CCD and the telescope, and allows you to load it up with a selection of different filters, and swap these as and when necessary without having to remove the camera and change filters manually.  This has multiple benefits – speed of change, less chance of getting your filters or CCD dirty, having a much lower chance of having to refocus, not having to reframe following the change, etc etc.  I think you get the idea.    There are two major flavours of filter wheel – the manual type, which you turn, well, manually, and the USB type, which you turn via an ASCOM driver from your laptop.  The former is good.  The latter is heavenly.

I opted for the latter with one thing in mind – automation.  I have a ZWO EFW 8-position USB filter wheel, currently loaded with Luminance, Red, Green, Blue, OIII, Ha and CLS filters, with an additional space ready for the SII when I get around to it.  Once loaded into the wheel, these can be swapped in and out of the imaging train at will, or filter swaps can integrated into a capture sequence via capture software.  My current weapon of choice for capture is SGP (Sequence Generator Pro) by Main Sequence Software (

My main remaining issue was that of focus.  Focusing the scope correctly is absolutely paramount for getting decent images.  Focusing is also an extremely labour-intensive (so to speak) part of the whole capture routine.  It’s the one place where you have to manually intervene throughout the capture sequence, as every time a filter is changed, or the temperature varies more than a couple of degrees, the scope requires refocusing to keep those stars pinpoint sharp, especially with the less expensive doublet scopes that I use for imaging, which don’t focus each wavelength of light perfectly at the same point.  This means keeping capture sequences to just one or two filters a night, or staying up all night to babysit the process, and refocus every time you change filters etc.  I’m now in my 40s with kids, and staying up on an all-nighter, at least regularly, isn’t something that comes quite as naturally anymore :).   How to solve this?  An Autofocuser, that’s how….

An autofocuser is a piece of kit that attaches to your telescope’s focus knob.  It’s usually based around a stepper motor, and allows movement of the focuser in extremely accurate and tiny steps from your capture PC.  Link this into software such as SGP, and you have a system that takes a shot, checks focus, moves the focuser, takes a shot, checks focus etc, until it figures out the point of best focus, then finishes by returning to that point, with your image (generally) in pretty-much perfect focus.

The main issue with autofocusers is they are definitely not cheap.  There are many available on the market, of varying quality and price.  The very cheap focus motors you can buy (sub £50) are not stepper-motor based, and generally use a simple DC motor linked to a battery-powered handset, which enables you to go in, out and change the speed.  They also generally don’t link to USB, and don’t provide the accuracy required to perform auto-focus form a PC even if they do.  The more capable, which are based around a stepper motor, generally cost £250 upwards, and although very good, the price put me off.

So… let me introduce you to the myFocuserPro2 project.

This is an open-source Arduino-nano-based motorised focuser project, based around readily available components as well as a cheap (4 for £8 last time I bought some) Clone Arduino Nano microprocessor board, a DRV8825 stepper driver and a Nema 17 Planetary Geared stepper motor.

Due to the fact that this project is constantly updated, and the above Sourceforge site is by far the best source of current information about it, then I won’t try and repeat everything here, as that would be well and truly reinventing the wheel.  I’d say this project is of medium difficulty for most.  It doesn’t require a massive amount of electronics knowledge, as its kind of mapped out for you, but there are multiple ways of doing the same thing – some harder than others, so a few tips…

  1. READ THE DOCUMENTATION on the site. Then read it again.  Then do some digging around it, then read it again.  Print it out and read it on the toilet. Do whatever you need to do to familiarise yourself with it – that way you’ll avoid making mistakes that could potentially be costly, or just plain frustrating.  There are several main PDF files in there, and they are very, very comprehensive.  It’s also extremely readable compared to many similar projects I’ve seen.  There are multiple options for various aspects of this, and choosing the most suitable one for your setup is key.   It also contains lots of good advice on what NOT to do – this is particularly important as if you have a rack and pinion focuser (which I don’t), then you can end up over-cranking it and stripping the gears – these geared steppers are very high-torque, which they need to be, but if you don’t pay attention to the warnings, you could easily damage your kit.  That would be bad.
  2. Take your time sourcing components and other bits and bobs.  This isn’t a project to rush, especially if you’re new to this stuff.  I sourced the vast majority of the electronic components form a combination of RS components (UK) which has free next day delivery, and eBay.
  3. The Pre-Made PCB – Worth It!

    Think seriously about buying a pre-made PCB. I am pretty savvy with electronics, but I made the decision early on to go for a pre-made PCB for this project.  There are multiple options, and you can assemble the whole thing on strip board, but there was a fair bit to think about, and I decided to make that bit easier.  The site contains all the info required to order a pre-made PCB from Aisler in Germany.  This costs about £25 if I remember correctly (for 3x boards – so you’ll have spares or can spread the cost if a few people are building them).  It makes the whole thing a lot easier.  Agreed it takes a little of the ‘homebrew’ away, but there’s plenty of home-brew left to satisfy.

  4. Find a decent supplier of stepper motors, and buy the right one!  There are some calculations you have to do that will guide you to the best stepper to buy for your setup.  Both of my refractors work well with a Nema 17 1:27 planetary geared stepper motor, which I bought from StepperOnline.  They have excellent service and supply to most of the world I believe.  With the shipping, the stepper came to about £27, which was overall the most expensive single component of the whole thing. However – this is the business end that interfaces with your scope, and its worth getting right.  The particular model I bought, and one which seems very popular, is the 17HS13-0404S-PG27. Some info with links is available in the box below, but bear in mind that these are current at time of writing, but may become out of date as time goes by.  
    Sourcing a Stepper
    The 17HS13-0404S-PG27 is available here at time of writing, or more expensively, from the same supplier, via Amazon.  Also available from the Supplier or (again more expensively) from Amazon are the are the brackets for the same stepper, which makes mounting them a bit easier, as making them yourself is a bit of a faff if you don’t have the right tools.
  5. Use risers for your Arduino and Stepper driver, and connectors for your cables. This makes it MUCH easier to swap them out if you manage to fry things now or in the future.  Having wires you can disconnect, rather than having them hard-wired in, makes it much easier to troubleshoot and swap things out.  It takes a bit more time initially, but is worth it in the long run.
  6. If you have more than one scope, then make it easy to move the stepper between them. I used a piece of aluminium bar on each scope to which the bracket is fixed with bolt and wing nuts.  This means that with minimal tools, I can move it from scope to scope.  I may invest in another stepper at some point, but to be honest, I only ever have one going at once, so may not bother.  It’s worked well so far.
  7. Spend time rebalancing your scope after adding the stepper. One thing about this autofocuser is that the motor isn’t light..!  It weighs in at about 0.5kg and protrudes from the side of the focuser as it’s attached in place of the focus knob (the single-speed one, not the dual-speed one on the other side – it’s not recommended to attach it to that as the torque can do quite a lot of damage apparently).  I’ve overcome this as both of my scopes have rotatable focusers, enabling me to get the stepper above the centre of gravity of the scope, and minimising it’s effect on balance.

I housed the whole lot in a pair of project boxes that I sourced from good old Maplin (RIP) just before it went under.  However, these are easy to get on eBay or elsewhere.

This project has been fascinating for me as it’s presented numerous challenges. I’ve had to overcome.  Firstly I’ve had to learn Arduino from the ground up.  It’s not too hard to get to the point where you have enough knowledge to do what you need to do for this project  (basically get some libraries installed and upload the relevant code to the Arduino via USB).  However, I’ve also learnt a lot about Arduino on the side, which as been really interesting.

Secondly, I’ve had to overcome the physical issues around getting the thing attached to my telescopes.  The worst issue I encountered here was the fact the several of the bolts on my Altair 102ED scope were cross-threaded (from the factory too!), meaning I ended up having to drill them out and re-tap the holes to attach the bracket.  Not impossible, but a bit of a faff.

The whole lot interfaces with your software via good old ASCOM.  The ASCOM driver is of course available on the sourceforge site, along with a small utility to connect to and play with the focuser.  The Arduino itself is detected as a USB serial interface, so all of the comms is actually serial-based, and is done via a comms port on the PC.  The ASCOM focuser is picked up by both SGP and APT with absolutely no issues, and works flawlessly.

The sum total of all this work was that I now have a setup that I can set going in the evening, and leave overnight to carry out an entire capture sequence, including changing filters, refocusing, and even meridian flip (via SGP), followed by parking the scope.  I’ve captured some of my best images this way, as I can now get far more integration, and over several nights on the same object.  I’ve managed about 14hrs on a single object over a few nights this way.  So far the auto focus hasn’t failed me.

So to conclude, here’s gallery of images from the build process, which will hopefully provide some idea of what’s involved.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.