Jump to content

sgl_imaging_challenge_banner_31.thumb.jpg.b7a41d6a0fa4e315f57ea3e240acf140.jpg

Arduino INDI-compatible DC Focuser


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 post
Share on other sites

Is the raspberry ok.not capable of providing the necessary control to the motor without having to include the arduino?

sorry, I'm about 10yrs behind on this tech ?

Link to post
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 post
Share on other sites

? python I have no clue about

i was assembly and/or C - Ancient stuff

As a Mac user, I've been considering INDI; need more investigation as there's a dearth of drivers.

Link to post
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 post
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 post
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 post
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 post
Share on other sites
  • 2 weeks later...

Good morning wimvb,

Is it possible that you communicate me a photo of your Arduino card with the different components linked ?

Thank you in advance.

Hedi

Edited by safaritn
Link to post
Share on other sites
  • 3 weeks later...
3 hours ago, abhoriel said:

Looks good, I might try this out!

It works good too. I autofocus with ekos/kstars from my livingroom. No need to go outside to refocus.

  • Like 1
Link to post
Share on other sites
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 post
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 post
Share on other sites
2 hours ago, Jan S said:

Do you think you can help?

I'm not sure. The code you have there looks like html, and could be part of a file which I adapted. I will have to look into it.

Link to post
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 post
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 post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By HN50
      My attempts at SID monitoring have been languishing for a while due to radio problems, though I have been getting to grips with Arduino and even had a go at building my own.
      In order to move things along I went to the UKRAA stand at Astrofest and bought the VLF radio kit, their signal generator and the 15V power supply.
      Last weekend I soldered the board.  It wasn’t too difficult following their instructions which are pretty clear.  The only fiddly bit was soldering on an SMD capacitor but they also give you a through-hole one as well.  Initial tests suggest it is working but I will have a better idea when it is all connected.

      This weekend I have been working on the housing and hopefully tomorrow get the leads soldered.  From left to right will be led power, 15V in, 15V out, antenna in, then analogue -ve and +ve (can be 5V or 2.5V).  
       


      I am building it as-is, so the first iteration will have the radio running off mains power and in turn the radio will power the Arduino.  That seems a bit backwards but I would just like to get logging data.  For the time being it will write to an SD card, but the Arduino MKR 1010 looks rather good and comes with WiFi and encryption.
      That though, is a long way off..!  Anyway, this shows progress so far.
    • By wimvb
      I recently posted my design for a weather station in this section.
      https://stargazerslounge.com/topic/345153-indi-weather-station/
      As I had bought several pressure/humidity sensors, as well as ir temperature sensors and ESP32 development boards, I wondered how small a weather monitor could get. The sensors are quite small, and so is the micro controller. Such a weather monitor wouldn't incorporate wind speed measurement nor a rain detector, since these take up more space. But otoh, there is seldom rain without clouds, so if you detect clouds, you should be safe.
      Here it is, a miniature (9.8 x 5.9 x 2.7 cm) weather monitor. The device has built in wifi, is powered from a micro usb contact and is compatible with the INDI Weather Watcher driver.
      The parts:

      (the mat underneath has a 1 inch grid pattern)
      BOM:
      plastic box 9.8 x 5.8 x 2.7 cm a piece of V-board, in my case with copper islands rather than strips ESP32 development board with male headers MLX90614 ir temperature sensor with I2C interface BME280 environmental sensor with I2C interface micro usb cable and power adapter, or a powerbank for wireless operation Assembly is really easy and involves drilling a hole in the box, soldering the components in place and wiring to the ESP.
      The finished monitor in place. As this is a box with a click lid, I used silicone to seal it. The holes on the sides and bottom are drilled at an angle to keep rain out.

      As I built it, the electronics will heat the BME slightly, and because it is mounted inside the casing, it will be slow to reach ambient temperature should this change abruptly. Adding more holes near the ESP would take the inside temperature down. Otoh, temperature readings don't have to be that accurate, and you could use the MLX ambient reading for more accuracy.
      Here's the INDI control panel for the weather monitor

      (Wind and rain are simulated, because I was testing the driver when I took the screen shot)
      Here is how it looks in Ekos scheduler. The red marker indicates that weather conditions are bad. In this case clouds = 100 %. If the tickbox next to "Weather" is checked, Ekos will allow weather conditions to control an imaging sequence.

      And in the ROR driver

      (I know it says Dome, but the ROR driver is derived from the dome driver, and it's still under development. Besides, this is the simulator driver.)
      The code for the esp is on my github page:
      https://github.com/wberlo/indi_meteostation
      You need the files:
      bme280.py mlx90614.py boot.py (replace the ssid and password with your own, or comment/uncomment lines to create an access point) main_mini.py (which you will have to rename to main.py before uploading to the esp board)  
    • By wimvb
      For quite some time now I've been working on a small weather station. The idea is to add automation to an obsy I'm building. The weather station as is measures temperature, humidity, pressure and presence of cloud. I also have the components to build a rain detector, but haven't implemented that yet.
      First the box:
      Made from vent covers and pieces of aluminium

      All put together

      With sensors. The IR sensor is in the far back (top of the housing) and the BME280 sensor is the free hanging red pcb. The other pcb holds a few pull-up resistors and a capacitor for the I2C wires. Insulation added to keep critters out.

      First I thought of using an Arduino to control and collect the data, but recently I started tinkering with ESP32 wifi boards. These are a lot faster and have more memory than Arduinos, and I wanted to use microPython.

      The ESP32 board is also smaller than an Arduino UNO (about the size of an Arduino nano) and has built in wifi, which means I just need power to the device.
      I uploaded the code to GitHub
      https://github.com/wberlo/indi_meteostation
      Output is as a HTML file (index.html) which presents data in a simple way. The INDI driver 'Weather Watcher' can read this file.
      For now, temperature is mapped to temperature (of course), and 'clouds' is mapped to 'forecast/Weather' in INDI. 'Clouds' is a parameter that varies from 0 to 1. I used the same criteria as the AAG Cloud Watcher device: if sky temperature is less than -8 degrees, the sky is assumed cloud free. For a sky temperature between -8 and 0 degrees, there is partial cloud, and for a sky temperature higher than 0 degrees, the sky is overcast. This seems very arbitrary, and I expect to have to adjust this piece of code later.

      Major update:
      The weather station now also reads and reports the SQM values from my wifi-SQM. 😋 See further down this thread for details.
       
    • By Waynescave
      Hi guys
      Can anyone identify which control box this is? Is it focusmaster? And does it run off robofocus driver in Indi lib as I cannot get a successful connection (in indi within ekos) 
      I bought a robofocus motor with this control box second hand. 
      I have faith with seller that hardware works as should. 
      I've tried other cables and USB ports too. The software (k stars) I use does do port search when connecting equipment.. 
       
      Any help appreciated 
      Wayne

    • By Piero
      I am selling my Moonlite installation kit for 8" newtonian focuser as shown here 
      https://www.firstlightoptics.com/moonlite-focusers/moonlite-installation-kit-for-newtonian-focusers.html 
       

       
      The installation kit was fitted on my 8" dobson in Italy and used very little (it is essentially new). I no longer need it as the focuser now sits on my 12" dob. 
      New £58, my price: £40 (including RM 1st class signed-for). PayPal (pay as a friend) or direct bank transfer.
      Also advertised on ABS.
      Thanks for looking,
      Piero
×
×
  • 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.