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

#51 tkottary

tkottary

    Viking 1

  • *****
  • Posts: 532
  • Joined: 06 Dec 2015
  • Loc: SunnyVale ,CA

Posted 05 March 2018 - 10:57 PM

That would be awesome if you could do it. I have all the parts ready except casing.

 

 

This looks like a very interesting project, and I already have all the necessary hardware in  my parts bins, but I am not able to find the wiring/assembly diagram for this anywhere. Just a few photos of the completed system. Could someone please share a link to a wiring diagram, ideally compatible with Fritzing. Thanks to the OP for a great job.

 

The components just stack together. The motor will use the 4 pins on the motor board, and the temp sensor uses pin 1 and +5v and ground.

 

If you purchase the components listed, I can give you more info if you need it when the parts arrive.

 



#52 Jmel

Jmel

    Vostok 1

  • -----
  • Posts: 101
  • Joined: 24 Jan 2012
  • Loc: Eastern North Carolina

Posted 06 March 2018 - 11:41 AM

 

That would be awesome if you could do it. I have all the parts ready except casing.

 

 

This looks like a very interesting project, and I already have all the necessary hardware in  my parts bins, but I am not able to find the wiring/assembly diagram for this anywhere. Just a few photos of the completed system. Could someone please share a link to a wiring diagram, ideally compatible with Fritzing. Thanks to the OP for a great job.

 

The components just stack together. The motor will use the 4 pins on the motor board, and the temp sensor uses pin 1 and +5v and ground.

 

If you purchase the components listed, I can give you more info if you need it when the parts arrive.

 

 

 

Sure - how far along are you? Have you stacked the components, and flashed the firmware yet?



#53 RDBeck

RDBeck

    Ranger 4

  • -----
  • Posts: 324
  • Joined: 13 Feb 2017
  • Loc: Montgomery, TX USA

Posted 07 March 2018 - 10:53 AM

There is no "clone or download" button.

"Download zip" results in a zip containing an executable file.

Which is a big security problem.

I was able to copy the raw text into local files.

I just realized you may not be able to see the clone or download if you don't have a GitHub account.  You might find it worthwhile to sign up.  I have had at least three GitHub references recently.



#54 KevinS

KevinS

    Messenger

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

Posted 09 March 2018 - 09:36 PM

I'm looking for code for the "PnP Focus Stick". Any idea when it might be available?



#55 KevinS

KevinS

    Messenger

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

Posted 20 March 2018 - 08:41 PM

Is there any news on when firmware for the focus stick will be available? 

No documentation, no advice, no working firmware, no response.

I know that it was posted freely, but I am starting to feel bad that I bought the hardware for this project and tried for months to make it work.



#56 RDBeck

RDBeck

    Ranger 4

  • -----
  • Posts: 324
  • Joined: 13 Feb 2017
  • Loc: Montgomery, TX USA

Posted 06 April 2018 - 08:42 AM

anat,

 

I have finally received all my parts and have successfully installed the sketch in Linux.  (Main issue was my user wasn't in the dialout group, oops.)  Preliminary testing indicates that all is working well here with the INDI Moonlight driver.  I'm using the Nema17 PG27 motor you listed in your initial post.

 

Now I have to design and print the cases and fittings.  I'll post those when I finally get it done.  It's early days for me with any of the CAD programs.

 

Thanks,

 

Richard



#57 RDBeck

RDBeck

    Ranger 4

  • -----
  • Posts: 324
  • Joined: 13 Feb 2017
  • Loc: Montgomery, TX USA

Posted 11 April 2018 - 12:35 PM

Can I just jumper the temperature sensor to the A1, 5V and GND ports on the motor shield?  I'm not sure I need the LCD after I get things tested out.

 

Edit -- I got out my multimeter and confirmed the pins matched up.  Also thinking about using 3 of the unused wires in the Cat 6 cable to carry the temperature signals so the sensor can be on the scope.


Edited by RDBeck, 11 April 2018 - 02:08 PM.


#58 burly 218

burly 218

    Lift Off

  • -----
  • Posts: 5
  • Joined: 26 Feb 2017

Posted 15 April 2018 - 02:02 PM

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 smile.gif

 

I will release the code soon.

was there any  update to this Anat?


Edited by burly 218, 15 April 2018 - 02:03 PM.


#59 StarmanDan

StarmanDan

    Aurora

  • *****
  • Posts: 4,760
  • Joined: 27 Aug 2007
  • Loc: Where the stars at night are big and bright...

Posted 17 April 2018 - 06:19 PM

Arduino newb here.  Purchased the parts and assembled, downloaded and installed arduino 1.8.5.  But when I plug in the assembled board, windows sees the new hardware attempts to load drivers, but still says unknown USB device and the arduino software won't see the hardware.  I've tried manually installing every driver in the arduino software and then a few I downloaded myself that looked primesing but no go.   Here is the Leonardo board I bought:  https://www.amazon.c...dSwL&ref=plSrch

 

Any advise? 



#60 anat

anat

    iAstroHub 3

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

Posted 19 April 2018 - 10:21 AM

was there any  update to this Anat?

The code for PnP FocusStick is here

https://drive.google...Ukk?usp=sharing

 

You will need to change the following pin setting in ArdumotoStepper.cpp because I use the original board:

http://www.gravitech...wfecoadfor.html

instead of the clone one. 

 

// Arduino pins for the motor control connection:
  this->motor_pin_1 = 5;
  this->motor_pin_2 = 6;
  this->motor_dir_1 = 4;
  this->motor_dir_2 = 7;


Edited by anat, 19 April 2018 - 10:23 AM.

  • KevinS and tkottary like this

#61 StarmanDan

StarmanDan

    Aurora

  • *****
  • Posts: 4,760
  • Joined: 27 Aug 2007
  • Loc: Where the stars at night are big and bright...

Posted 23 April 2018 - 11:30 PM

Wanted to say I've finally had success! The Leo board I ordered was bad and the new one works flawlessly. I, too, had issues downloading the upload.exe file. I tried downloading it several times at work, and the virus scanner kept quarantining it. A few hours later I got an earful from IT asking what upload.exe was and why my email was suddenly sending out adware. I'm getting a new laptop in a couple days as a result. But it's all working now along with the moonlite ascom driver so I'm happy. So much cheaper than a ready made focuser. Thanks OP for all your work!
  • MrCygnusX1 likes this

#62 burly 218

burly 218

    Lift Off

  • -----
  • Posts: 5
  • Joined: 26 Feb 2017

Posted 26 April 2018 - 02:03 PM

The code for PnP FocusStick is here

https://drive.google...Ukk?usp=sharing

 

You will need to change the following pin setting in ArdumotoStepper.cpp because I use the original board:

http://www.gravitech...wfecoadfor.html

instead of the clone one. 

 

// Arduino pins for the motor control connection:
  this->motor_pin_1 = 5;
  this->motor_pin_2 = 6;
  this->motor_dir_1 = 4;
  this->motor_dir_2 = 7;

Thanks anat 



#63 burly 218

burly 218

    Lift Off

  • -----
  • Posts: 5
  • Joined: 26 Feb 2017

Posted 26 April 2018 - 02:53 PM

Would these be the correct parts anat ,having no experience in this totally flying blind ,how do you control this using the pc 

https://www.robotsho...controller.html

https://www.robotsho...controller.html

https://www.robotsho...sensor-kit.html



#64 RDBeck

RDBeck

    Ranger 4

  • -----
  • Posts: 324
  • Joined: 13 Feb 2017
  • Loc: Montgomery, TX USA

Posted 05 May 2018 - 04:41 PM

I completed my focuser and have made my design of cases available on Thingiverse (https://www.thingive...m/thing:2895501).


  • ninosr and burly 218 like this

#65 KevinS

KevinS

    Messenger

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

Posted 06 May 2018 - 02:35 PM

I cannot get Arduino to compile the new stick code.

It complains that "hexstr2long' was not declared in this scope"

Has anyone else run into this error and how did you fix it?

 

 

Thanks



#66 KevinS

KevinS

    Messenger

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

Posted 11 May 2018 - 01:59 PM

Has anyone managed to get the stick code working? If so, could you share how?

It seems to be in Python instead of a Sketch. How does one use that in an Arduino?

Thanks



#67 davet39

davet39

    Lift Off

  • -----
  • Posts: 2
  • Joined: 05 Jun 2018

Posted 09 June 2018 - 03:47 AM

I managed to build the original project and connect it via ASCOM as I want to use it via my gamepad at the scope. Only issue is that I cannot get the stepper to rotate in both directions whatever I do - I have tried different sequences of connections to the ULN 2003 board to no effect - I'm not up on coding so can't delve into the .ino file to tweak.

 

I have checked this out by running a different sketch and the motor is reversing as expected.

 

Any help welcomed as I would like to pin this down and understand what is going on.

 

Is it possible to map outputs to different pins as I think this might be the issue for some reason as I am using the three stacked boards as listed in the original project


Edited by davet39, 09 June 2018 - 02:36 PM.


#68 anat

anat

    iAstroHub 3

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

Posted 12 June 2018 - 04:32 AM

For wiring, it depends on the motor you use. For the general idea, please read Appendix F in this document

https://sourceforge....ro.pdf/download

 

Anat

 

I managed to build the original project and connect it via ASCOM as I want to use it via my gamepad at the scope. Only issue is that I cannot get the stepper to rotate in both directions whatever I do - I have tried different sequences of connections to the ULN 2003 board to no effect - I'm not up on coding so can't delve into the .ino file to tweak.

 

I have checked this out by running a different sketch and the motor is reversing as expected.

 

Any help welcomed as I would like to pin this down and understand what is going on.

 

Is it possible to map outputs to different pins as I think this might be the issue for some reason as I am using the three stacked boards as listed in the original project



#69 anat

anat

    iAstroHub 3

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

Posted 12 June 2018 - 04:35 AM

Has anyone managed to get the stick code working? If so, could you share how?

It seems to be in Python instead of a Sketch. How does one use that in an Arduino?

Thanks

Sorry for my late response. Could you compile the code for PnP focuser? I didn't have a chance to simplify the installation process and to test the clone motor shield. 



#70 Tommy

Tommy

    Mariner 2

  • -----
  • Posts: 269
  • Joined: 11 Apr 2005
  • Loc: Milky Way

Posted 14 June 2018 - 09:43 PM

Can I have a diagram on how to connect all these up when on the field? 

 

For an example,

 

1. which cable is for ASCOM? The mini USB cable?

2. do we need 12v power for arduino and so on.........

 

Thanks.



#71 anat

anat

    iAstroHub 3

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

Posted 19 June 2018 - 03:41 AM

Can I have a diagram on how to connect all these up when on the field? 

 

For an example,

 

1. which cable is for ASCOM? The mini USB cable?

2. do we need 12v power for arduino and so on.........

 

Thanks.

1) The mini usb cable is for data communication

2) The voltage required depends on the motor you use. It recommend the motor with the voltage between 9-12 V which is the voltage range acceptable for the Arduino board. 



#72 anat

anat

    iAstroHub 3

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

Posted 19 June 2018 - 03:47 AM

Finally I have a chance to work on the PnP Focus Stick. The code is provided here

https://drive.google...Ukk?usp=sharing

 

The motor shield (by Deek-Robot) is wired to Pins D3, D11, D12, D13 in Arduino Micro. The total cost for this focus stick is $15. I don't have the temperature reading in the code. 

 

I also provide the laser-cut models for PnP Focus and PnP Focus Stick in the URL above. I found that the pins in the L298P motor shield by Keyestudio were longer than the motor shield I used for making the PnP Focus case. You may need to trim the pins of the motor shield or modify the lasercut model.

 

Anat

Attached Thumbnails

  • focus_stick.jpg

Edited by anat, 19 June 2018 - 04:22 AM.

  • mtc, tkottary and MrCygnusX1 like this

#73 StarmanDan

StarmanDan

    Aurora

  • *****
  • Posts: 4,760
  • Joined: 27 Aug 2007
  • Loc: Where the stars at night are big and bright...

Posted 09 July 2018 - 01:40 PM

So I'm having some issues getting the stepper motor (28BYJ-48) wired correctly.  Originally, I was having issues with the motor not wanting to reverse.  I have tried all combinations of wiring the stepper to the controller and have found several combinations that appear to resolve the reversal issue.  However, regardless of whether the unit is set to fast or slow, it appears to operate correctly in one direction, but slightly slower in the other (but not as slow as the slow setting).  Based on the vibrations of the motor it feels like it's half stepping in one direction and whole stepping in the other.  It does this regardless of if the motor is wired as bipolar or unipolar (which as I understand determines if the motor uses half or whole steps).  Perhaps I have a bad motor?  Also, I'd like it if the fast setting was somewhat faster.  Where would I change the value for this to increase the speed?  


  • pdufresne likes this

#74 jwestervelt

jwestervelt

    Viking 1

  • -----
  • Posts: 678
  • Joined: 01 Sep 2012
  • Loc: Phoenix, Arizona

Posted 09 July 2018 - 02:01 PM

Dan,

I edited my most recent post in that other thread with my findings.  It looks like the red wire should be grounded according to page 70 of the PDF that Anat linked. 



#75 StarmanDan

StarmanDan

    Aurora

  • *****
  • Posts: 4,760
  • Joined: 27 Aug 2007
  • Loc: Where the stars at night are big and bright...

Posted 09 July 2018 - 03:08 PM

Grounding the red wire produces no change in operation.  I've got another, larger 5 wire stepper on its way.  Hope that fixes things.




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