Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

PnP Focus: The simplest-ever Arduino focus controller

  • Please log in to reply
252 replies to this topic

#1 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 11 October 2017 - 09:56 AM

I want to share with you the Arduino-based focus controller named "PnP Focus". As the name implies, I want it to be as easy as "Plug and Play". No soldering. No hassle with firmware upload.
You simply 1) buy the readily available components, 2) stack them, and 3) upload the firmware by a single click. 

 

Features:
- Manual control
- LCD display
- Temperature sensor
- compatible with Moonlite ASCOM driver
- compatible with commercially available focuser motors.
I have tested with various motors from
- Robofocus
- Moonlite
- USB_Focus
All of them use the DB9 male connectors. It also works with the popular DIY stepper motors:
- 28BYJ-48  (5V and 12V)
- 17HS13-0404S-PG27 (12V)

 

Components required:
1) Arduino Leonardo board ($5-$10). I recommend the board by Keyestudio available at Aliexpress ($8). 
2) Ardumoto L298P motor driver board. Make sure that the board uses Pin 3, 11, 12, 13 for driving the motor. Fortunately, most of them are. I recommend the board by Keyestudio available at Aliexpress ($9).
3) 1602 LCD and keypad shield ($2-$10). I recommend the 1602 LCD and keypad shield by DFRobot ($10).
4) DS18B20 Temperature Sensor. I recommend the sensor by DFRobot ($4). The sensor is connected as shown in the figure below.

 

The total cost is just $30.

 

Installation:

1) Visit https://github.com/aruangra/PnP-Focus , download the file "upload.zip" and unzip the file.

2) Then connect the micro usb cable between Arduino Leonardo and your PC.

3) Double click the file "upload.exe". The firmware will be uploaded to the Arduino board. And it is ready. 

 

How to use:

- You can use the ASCOM Moonlite focuser driver to control the motor.

- For manual control, the keys are as follows:

LEFTMOST:  Save the position to EEPROM. For manual control, the position is not saved. Use this key to save the position. 

LEFT: Move in

RIGHT: Move out

UP: Backlight On/Off

DOWN: Fast/Slow movement

 

Let me know if you have any question. Thank you.

Anat

Attached Thumbnails

  • 20171011_175738.jpg
  • 1507712337226.jpg
  • 1507712356545.jpg

Edited by anat, 12 October 2017 - 06:53 AM.

  • ccs_hello, DHEB, OleCuss and 6 others like this

#2 mikefulb

mikefulb

    Surveyor 1

  • *****
  • Posts: 1,833
  • Joined: 17 Apr 2006

Posted 11 October 2017 - 10:22 AM

Interesting - is the source available?

#3 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 11 October 2017 - 10:28 AM

Interesting - is the source available?

Yes. I have just uploaded. Please see the above google drive again.

 

Anat



#4 pbunn

pbunn

    Vanguard

  • *****
  • Posts: 2,000
  • Joined: 29 Sep 2010
  • Loc: Spartanburg, SC

Posted 11 October 2017 - 11:08 AM

When I click on the link above I do not see - upload.exe

 

only pnp_focus.src



#5 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 11 October 2017 - 11:11 AM

When I click on the link above I do not see - upload.exe

 

only pnp_focus.src

Maybe the exe file is blocked. I zipped the file instead. Please see the link again.



#6 pbunn

pbunn

    Vanguard

  • *****
  • Posts: 2,000
  • Joined: 29 Sep 2010
  • Loc: Spartanburg, SC

Posted 11 October 2017 - 03:54 PM

  When I click on the link I only see a zip file  PnP_Focus_src.zip

'

I download that file and it has 7 files but no .exe file

 

It synchs with my Google Drive and shares the above zip file in my Google Drive.

 

I purchased the parts today and need to get the proper software


Edited by pbunn, 11 October 2017 - 03:58 PM.


#7 mikefulb

mikefulb

    Surveyor 1

  • *****
  • Posts: 1,833
  • Joined: 17 Apr 2006

Posted 11 October 2017 - 06:22 PM

Looks neat - I see you started with the same code base I did from orly.  I'd been looking for a cheaper motor board to use and the ardumoto you suggested looks great.  I ordered a few to give it a try.  These are cheap enough now I just put a focus controller on each telescope I use for imaging.



#8 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 11 October 2017 - 06:49 PM

  When I click on the link I only see a zip file  PnP_Focus_src.zip

'

I download that file and it has 7 files but no .exe file

 

It synchs with my Google Drive and shares the above zip file in my Google Drive.

 

I purchased the parts today and need to get the proper software

I changed to use GitHub. 

https://github.com/aruangra/PnP-Focus

instead due to some difficulty with the Google Drive. Let me know if you have any problem.

 

Anat



#9 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 11 October 2017 - 08:02 PM

Looks neat - I see you started with the same code base I did from orly.  I'd been looking for a cheaper motor board to use and the ardumoto you suggested looks great.  I ordered a few to give it a try.  These are cheap enough now I just put a focus controller on each telescope I use for imaging.

Arduino Leonardo has its own serial port. So there is no reset issue when establishing the connection as one may observe in Arduino Uno. The ardumoto shield uses pins D3, D11, D12 and D13 while the LCD shield uses Pins D4-D10 and A0. The temp sensor uses pin A1. So everything matches. :)



#10 pbunn

pbunn

    Vanguard

  • *****
  • Posts: 2,000
  • Joined: 29 Sep 2010
  • Loc: Spartanburg, SC

Posted 12 October 2017 - 09:29 AM

Thanks - I got it. I hope to build it when the parts arrive.


  • anat likes this

#11 Fly2High

Fly2High

    Vostok 1

  • *****
  • Posts: 180
  • Joined: 04 Dec 2015
  • Loc: Long Island, NY

Posted 12 October 2017 - 03:50 PM

Forgive me for this question but I have not been around telescopes that much.

 

What does a focus controller do?

 

 

Is it just to have remote ability to focus electronically?

 

When would you use one?

 

Does it focus automatically?  Is it looking through the eyepiece or what if it does it automatically?

 

Hope this doesn't derail the thread.



#12 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 13 October 2017 - 07:33 AM

Forgive me for this question but I have not been around telescopes that much.

 

What does a focus controller do?

 

 

Is it just to have remote ability to focus electronically?

 

When would you use one?

 

Does it focus automatically?  Is it looking through the eyepiece or what if it does it automatically?

 

Hope this doesn't derail the thread.

With a motorized focuser, you can

- get the higher resolution since a stepper motor may have 3000-4000 steps per revolution. The higher resolution is crucial for imaging.

- control the focuser locally or remotely from the PC. When you do imaging, you have to handle your devices via a PC and software. 

- automate focusing. 

 

For visual observation, the fine focus knob with the reduction gear is more convenient. 

 

Anat


  • xiando likes this

#13 Andy Tucker

Andy Tucker

    Explorer 1

  • -----
  • Posts: 68
  • Joined: 05 Dec 2013

Posted 13 October 2017 - 10:26 AM

If your mount is less than rock-steady, focusing electronically with a controller in your hand might help for visual work as well.


  • anat likes this

#14 RAC

RAC

    Viking 1

  • -----
  • Posts: 759
  • Joined: 30 Sep 2011
  • Loc: New Zealand

Posted 13 October 2017 - 02:07 PM

If your mount is less than rock-steady, focusing electronically with a controller in your hand might help for visual work as well.


Absolutely. Years ago I had a friend write me a small arduino program that runs a stepper motor from a little joy stick so I have in and out, fast and slow and everything in between. It's a god send to my planetary imaging and viewing with my dob.
  • anat likes this

#15 RobF2

RobF2

    Sputnik

  • -----
  • Posts: 45
  • Joined: 10 Dec 2009
  • Loc: Brisbane, Australia

Posted 15 October 2017 - 10:03 AM

Nice!  What case are you using to hold the project?  Is it water/dew proof?



#16 Geo.

Geo.

    Vendor - Nexstar Parts

  • *****
  • Vendors
  • Posts: 5,430
  • Joined: 01 Oct 2008
  • Loc: Upstate NY

Posted 15 October 2017 - 10:09 AM

Nicely done. 



#17 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 15 October 2017 - 05:34 PM

Nice! What case are you using to hold the project? Is it water/dew proof?

I made a lasercut enclosure for it. There are openings for the LCD, buttons, and port for the temp sensor. So, it is not weather-sealed, similar to most commercial focus controllers. It is fine if the controller is not placed on the telescope, If you want to place it on the telescope, you can place a 2"-3" wide clear tape to seal the gaps.

Anat

Edited by anat, 15 October 2017 - 07:23 PM.


#18 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 15 October 2017 - 06:03 PM

As you can see from my first post, the typical wiring of the robofocus/moonlite motor is...

https://sourceforge....ar - beware.png

 

http://www.hurst-mot...ram_Stepper.gif

 

 

If disconnecting the DB-9 pin No. 5 from V+, the motor will operate as a bipolar motor. It will have more torque and the motor is less warm when idle.  It is recommended.

 

For bipolar vs unipolar motors, please read

https://alselectro.w...h-l298-arduino/

 

 

 

 

 

Attached Thumbnails

  • 20171015_070114.jpg
  • 20171015_190521.jpg


#19 laixiaolue

laixiaolue

    Vostok 1

  • *****
  • Posts: 193
  • Joined: 25 Mar 2017
  • Loc: USA

Posted 16 October 2017 - 12:20 PM

Good idea. I just ordered the Arduino board and will do something similar.



#20 Fly2High

Fly2High

    Vostok 1

  • *****
  • Posts: 180
  • Joined: 04 Dec 2015
  • Loc: Long Island, NY

Posted 16 October 2017 - 12:55 PM

thanks



#21 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 24 October 2017 - 01:26 AM

I made another focus controller aimed for PC control. It is called "PnP Focus Stick" 

The following parts are used:

 

1) Arduino MICRO which has the 32u4 micro controller ($6)

2) L298P motor shield for Arduino Nano ($5)

3) DS18b20 temperature sensor ($2-4)

 

It costs $15 in total :) 

 

I will release the code soon.

Attached Thumbnails

  • 20171023_124404.jpg
  • 20171023_130339.jpg

  • PrestonE, korborh, KevinS and 3 others like this

#22 KevinS

KevinS

    Messenger

  • -----
  • Posts: 476
  • Joined: 27 Dec 2011

Posted 25 October 2017 - 11:44 AM

I like the stick controller. I've got a drawer full of Nano's will the shield and code work with one?



#23 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 25 October 2017 - 02:33 PM

I like the stick controller. I've got a drawer full of Nano's will the shield and code work with one?

Only MICRO works since the 32u4 microcontroller has its own serial port.

Sent from my SM-G930F using Tapatalk

#24 mikefulb

mikefulb

    Surveyor 1

  • *****
  • Posts: 1,833
  • Joined: 17 Apr 2006

Posted 05 November 2017 - 03:47 PM

Put one of these together and I'm going to make a few more.

 

3D printed a case and Losmandy mounting plate - photos here:

 

http://msfastro.net/...pment/pnpfocus/

 

I made a few adjustments to the code to support different stepping speeds and FULL/HALF stepping - would you like to take a look at the code?


  • anat likes this

#25 anat

anat

    iAstroHub 3

  • *****
  • Vendors
  • topic starter
  • Posts: 1,102
  • Joined: 03 Jun 2004

Posted 05 November 2017 - 05:46 PM

Put one of these together and I'm going to make a few more.

3D printed a case and Losmandy mounting plate - photos here:

http://msfastro.net/...pment/pnpfocus/

I made a few adjustments to the code to support different stepping speeds and FULL/HALF stepping - would you like to take a look at the code?

Thanks. I cannot access the URL. Yes. Please share the code. Can I merge it to my code Github ?

Sent from my SM-G930F using Tapatalk


CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics