Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Arduino INDI-compatible DC Focuser


wimvb

Recommended Posts

Imaging season is still a few weeks away up here, but I've started dusting of my gear and upgrading some parts.

One step closer to automation is a motor focuser, and I opted for a budget solution. I bought a SkyWatcher DC focuser and built a computer control for it. Since I use INDI for my automation, I had to find a way to connect the focuser to indiserver. A first thought was to use the INDIduino code, but after some coding and testing I found out that this code is very limited and not really supported by indi clients. The Ekos/Kstars focus module can't be used for focus control if you use INDIduino, apparently.

But then I stumbled upon an Arduino solution that emulates the MoonLite focuser (http://www.indilib.org/forum/general/283-moonlite-focuser-protocol.html). Unfortunately, this protocol is for a focuser with a stepper motor, whereas the SkyWatcher has a geared DC motor.

I had already rewritten some code from stepper to (geared) DC motor, so it was easy to adapt this to the MoonLite based code.

My solution consists of the following:

hardware:

- SkyWatcher DC focuser (only the motor is used, the handbox is replaced by the Arduino)

- Arduino UNO

- Velleman motor controller shield for Arduino

- 9 V power adapter to power the shield

- Raspberry Pi

 

software:

- Arduino sketch with Geared Motor library (see below for link)

- INDI server on RPi, and client (Ekos/Kstars) on Windows

 

I've tested this setup on my SkyWatcher Explorer 150PDS and it runs fine. Unfortunately I haven't been able to test the autofocus, due to absence of astrodarkness and clear skies.

Since a DC focuser has no knowledge about the position of the actual focuser, the software assumes that position '0' is all the way in. Maximum position is 25000 for my setup. By default, focus is increased by 100 steps, which is supposed to be 100 ms of motor drive.

focuser.jpg.1457c3a1c67a49a2256cf027b1c70a3c.jpg

BTW, the code is in my GitHub repository:

https://github.com/wberlo/Arduino_Moonlite_Focuser

Edited by wimvb
added link to original
Link to comment
Share on other sites

It may very well be that the raspberry pi can control a motor directly, but I had a motor controller for the Arduino, and I'm not that familiar with Python and GPIO programming. For me this was the easier solution.

Besides, I have INDI running on the Raspberry Pi, and I want to keep this as clean as possible. The Arduino basically emulates the MoonLite focus controller box.

Link to comment
Share on other sites

Neither do I.

INDI is great. With just a Raspberry Pi, an eqdir cable and a camera (I've used my asi 120 guidecam for testing), I can have complete remote control of my setup, excluding polar alignment. That's quite a step up from a dslr with an intervalometer.

  • Like 1
Link to comment
Share on other sites

I'm running Celestron mounts, so, EQDIR isn't an option ??, but I've been working on that aspect and there are still issues around limiting RA/DEC to prevent cable wrap and tracking below horizon.

my guide cam (qhy6) isn't supported

i need to look into it specifically, but, I think the ZWO1600 is supported.

Over 40 years with 'IT' , but I am getting slower in uptake. Lack of time doesnt help either

 

Link to comment
Share on other sites

I use the ubiquitous 28BYJ-48 geared stepper motors for focussing, with timing belt or geared drive and A4988 stepper driver modules running directly from the RPi 3.  I posted a thread about it - I'll see if I can find it...

Edited by Gina
Link to comment
Share on other sites

7 hours ago, iapa said:

I'm running Celestron mounts, so, EQDIR isn't an option ??, but I've been working on that aspect and there are still issues around limiting RA/DEC to prevent cable wrap and tracking below horizon.

my guide cam (qhy6) isn't supported

i need to look into it specifically, but, I think the ZWO1600 is supported.

Over 40 years with 'IT' , but I am getting slower in uptake. Lack of time doesnt help either

 

Indi should support celestron nexstar.

http://indilib.org/devices/telescopes/celestron.html

It seems that qhy support is limited. There are several threads in the indilib forum indicating trouble with qhy cameras. This is the main reason for me not to buy qhy. Zwo has much better support. All their cameras seem to work with indi, and any issues are generally addressed very quickly.

I have programmed a fair bit, both in my work and privately. But always just to solve problems, never as a professional programmer. So, I always have to keep a reference manual handy when I start a new project, to get the syntax right.

@Gina, I have been following your thread(s) with great interest. I opted for the SW DC focuser mainly because of the hardware and because it required less diy mechanics to get working. (Don't have a 3d printer. :grin:) Steppers are better for focusing, and I have a couple lying around. But I knew the SW would attach to my scope without any issues. I find arduino easier to control  hardware, and don't want to mix my efforts of hardware control with vital functionality such as guiding, on the same RPi. I plan to use two RPi's for my setup; one for mount control and guiding, and one for imaging and focusing. RPi's are cheap, and this will give me some redundancy.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
5 hours ago, abhoriel said:

Excellent, I guess despite not using a stepper motor, its precise enough. :D

You be the judge to that:

I've never had such distinct star spikes before. Considering a 1.6 "/pixel image scale, I'm very satisfied.

The geared motor does have a lot of backlash, which my arduino code could compensate for. But the moonlite driver has no backlash compensation. Still, the autofocus routine in Ekos handles this fine.

Link to comment
Share on other sites

  • 3 years later...

Hello there! I was wondering if you could help. I found your setup very interesting and decided to go for it (thanks for that!! :) ). I am however having issues to compile the code and to upload it to arduino... the error is like this:

image.png.1c210e142f7693d02bd0034a9c7a133e.png

Do you think you can help?

Thanks in advance!

Link to comment
Share on other sites

2 hours ago, Jan S said:

Do you think you can help?

Actually, the section you show is not part of the code as I have it on github. Did you copy and paste this from a webpage? If so, I think you also copied a section of html. This is a link to the code

https://github.com/wberlo/Arduino_Moonlite_Focuser/blob/master/Arduino_Moonlite_Focuser_V1.ino

Link to comment
Share on other sites

18 hours ago, wimvb said:

Actually, the section you show is not part of the code as I have it on github. Did you copy and paste this from a webpage? If so, I think you also copied a section of html. This is a link to the code

https://github.com/wberlo/Arduino_Moonlite_Focuser/blob/master/Arduino_Moonlite_Focuser_V1.ino

Oh, okay, will need to have a look into that once again. I have just downloaded the ino file and opened in IDE, downloaded and added the library. I have seen some differences, but was not sure in it. Honestly, it is for the fist time I am using it...

Thanks for your feedback and support, hope I will make it run :)

Cheers!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.