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
436 replies to this topic

#426 tjay

tjay

    Gemini

  • *****
  • Posts: 3,349
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 21 June 2024 - 03:27 PM

Steppers at the required resolution for focusing are generally not very fast.  Usually, it's not a problem since you are only going through a very small range to get into focus, but in cases where you need a wider range of focus, it's can be an issue.



#427 Jem45472

Jem45472

    Sputnik

  • -----
  • Posts: 49
  • Joined: 13 Sep 2018

Posted 21 June 2024 - 03:48 PM

Steppers at the required resolution for focusing are generally not very fast.  Usually, it's not a problem since you are only going through a very small range to get into focus, but in cases where you need a wider range of focus, it's can be an issue.

Like in my case when I image with hyperstar at f2, and planets at f20 lol. Time for a nap in between  that range.


  • tjay likes this

#428 tiddler

tiddler

    Explorer 1

  • -----
  • Posts: 70
  • Joined: 31 Aug 2008

Posted 21 June 2024 - 08:04 PM

I realise this has been a long running thread but perhaps someone can help.

 

Using the latest PNPFocus I have uploaded the firmware to my Arduino Leonardo with a  DIY More L298NH Motor Shield and connecting a Moonlite focus motor.

 

It runs fine, albeit slow, connecting via a PC and the Moonlite DRO app and I can send it to positions in/out correctly. However a single 360 revolution is taking about 32 seconds (2 rpm) is that right or way too slow?

 

If too slow what needs changing to correct it?

 

Thanks

 

BTW my intention is to connect the Arduino to an unused ASIAirPro running Astroberry to remote focus my solar telescope and use Firecapture also running on the AAP. 

Stevie

 

Hard to say what the issue is as there is literally no information about configuration and use in play.  What was the max rate you selected in the driver? If the 360 degree movement occurred what was the stepper position change from start to end position?  You identified you commanded from pc to move in/out.  How many steps did you command.  Can you correlate that the number of steps taken for 360 degree shaft rotation is the same as the stepper motor specification?



#429 StevieDvd

StevieDvd

    Mariner 2

  • -----
  • Posts: 252
  • Joined: 26 Apr 2011
  • Loc: England, UK

Posted 22 June 2024 - 03:21 PM

I think I have it sorted now and a revolution (3600 steps) takes about 18 seconds and is nice and smooth.  I did some comparisons with my older focus controller (lakeside) using a moonlite & lakeside stepper motor and got the same results.

 

Using the moonlite indi focuser it works but reports a serial error timeout but I have not found the cause of that or if it's a problem or not.

 

Did have a little mishap as the old usb/serial cable adapter was recognised for a while and just disappeared from the list of ports. I switched that over to Raspberry PI to check if that fared better, it did not the cable was faulty.  It started to smoke and was too hot to touch. Thankfully pulling the power leads from the power bank stopped anything serious so no hardware was damaged apert from the cable itself.

 

The power pack I use indoors for this type of testing or recharging phones etc has a habit of powering off if the current draw drops. Much to my annoyance when I was changing settings and the motor stopped working and me not noticing the power being off, doh!!!

 

Just need to 3d print a new case for the Arduino/motor shield and test it out in the ASIAir Pro.


  • tiddler likes this

#430 StevieDvd

StevieDvd

    Mariner 2

  • -----
  • Posts: 252
  • Joined: 26 Apr 2011
  • Loc: England, UK

Posted 04 July 2024 - 11:02 AM

I decided to try out the PNP-Focus Stick as well and received the motor shields from Ali-Express as I could not find them from a UK supplier.  I got 2 for around £11 ($13) which is fine though an official Arduino Micro cost  £23 ($27) from Amazon UK  as I did not want to risk a cheaper clone at first.

 

All connected and running fine now. Just need to 3d print a case which allows for the motor wire. I've seen the existing stl but that has no access for the motor cabling, so if anyone has modified it successfully I'd appreciate a picture so I can replicate it here.

 

Thanks to @tiddler for the helpful youtube video especially for the tip on testing without a motor connected.



#431 notmeagain

notmeagain

    Lift Off

  • -----
  • Posts: 4
  • Joined: 06 Dec 2023

Posted 12 August 2024 - 03:19 AM

I've built a total of 3 variations of this controller, the latest tweak is incorporating an i2c 2004 lcd display and a temp/humidity probe in place of the temperature probe, the other 2 are vanilla stick and box versions.


In all variants I'm using a Nema 17HS13-0404S-PG27 and have a question.
I'm using the official nano motor shield on the stick, and a diymore deek-robot l298n rev 3 shield (cutting sense 1 to free up the lcd analog) on the full-sized version.


The videos I've seen of the nema motors show they're not particularly noisy motors. All of mine make an audible clunk per step, and buzz momentarily once completed movements, compounded by the resonance of the tube, turning my OTA into a windchime, or a horn sounding instrument... 😀


Holding the motor you can feel it going cuchunk cuchunk cuchunk.


Is this normal? Are your nemas noisy or quiet?


I've used a 12v 3a wall wart psu, measuring a constant 12v at the motorshields power in.


I've triple (over a dozen times actually) checked step order and shaft rotation, pin allocation in code and pin outs to the shield.


I've seen that engaging the nema coils can result in high current draw, as it fights the pull of the magnets to get a rotation started, is this the issue? Are my motors too strong?


Again, a lot of videos show the nemas making a whine instead of this thump, have I done something incorrectly?

Edited by notmeagain, 12 August 2024 - 05:05 PM.


#432 MonteWilson

MonteWilson

    Sputnik

  • -----
  • Vendors
  • Posts: 33
  • Joined: 21 Aug 2020

Posted 19 August 2024 - 02:39 PM

Hi Guys - I have run into an issue with the motor shield. I purchased an Arduino branded version with the correct pin assignments but when installed it is exhibiting the strange behavior associated with the wrong logic voltage (3.3v vs 5v) its vibrates but goes nowhere. Should be an easy fix but my board doesn't have the jumper that I can alter. I am missing something? There is a surface mount component in the general area of the 3.3v and 5v pins but I can't find any explanation of its role. I can order a Keyestudio one but there is the usual delay in getting stuff to Australia which I would love to avoid if there is a simple fix. Regards Monte

 

EDIT: I just noticed the Arduino documentation says the shield is compatible with the UNO and doesn't mention the Leonardo. So maybe that's my answer.

 

s-l1600.jpg

 

This is the unit I have: https://www.ebay.com...a50759aca473b61


Edited by MonteWilson, 19 August 2024 - 05:14 PM.


#433 notmeagain

notmeagain

    Lift Off

  • -----
  • Posts: 4
  • Joined: 06 Dec 2023

Posted 22 September 2024 - 06:59 AM

Hi Guys - I have run into an issue with the motor shield. I purchased an Arduino branded version with the correct pin assignments but when installed it is exhibiting the strange behavior associated with the wrong logic voltage (3.3v vs 5v) its vibrates but goes nowhere. Should be an easy fix but my board doesn't have the jumper that I can alter. I am missing something? There is a surface mount component in the general area of the 3.3v and 5v pins but I can't find any explanation of its role. I can order a Keyestudio one but there is the usual delay in getting stuff to Australia which I would love to avoid if there is a simple fix. Regards Monte

EDIT: I just noticed the Arduino documentation says the shield is compatible with the UNO and doesn't mention the Leonardo. So maybe that's my answer.

s-l1600.jpg

This is the unit I have: https://www.ebay.com...a50759aca473b61


Same board I have.

You'll note on the back side that there's some small solder pads marked brake a/b/sns1/sns0 etc.

These bridge the pins on the shield to other parts on the board, this caused the same behaviour for me as things conflicted.

Using a craft knife, cut between the two pads to break the connections, since I'm using 12v motors I also cut the vin pads.

You can always solder them back together.

If you follow the traced you might see that one of the analogue pins is connected.

I can't recall exactly cutting which pads resolved my issues, but they are all cut now.

#434 tiddler

tiddler

    Explorer 1

  • -----
  • Posts: 70
  • Joined: 31 Aug 2008

Posted 22 September 2024 - 11:46 PM

You know guys we give you the specific boards to use  as listed in the PNP focus documentation and you go and use something different.  The arduino motor shield is not same as the ardumoto L298P motor drive board.   This deviation is not compliant with the form-fit-function of the PNP focus design project.   Uncharted actions like this becomes your situation to figure it out.  The arduino motor shield may work but if you intend on using the 1602 LCD panel and keyboard shield, then the arduino motor shield uses pins which conflict with the 1602 LCD panel.  Hence you will have to modify the code to make it work with your specific situation.  Hence it no longer becomes form-fit-function of the PNP focus design project and should be taken to a different project name and discussion thread.  



#435 jlevick82

jlevick82

    Lift Off

  • -----
  • Posts: 1
  • Joined: 08 Mar 2025

Posted 09 March 2025 - 08:18 PM

Pretty sure i fried my l298P motor board for the stick,  Went back to building the standalone build.  I got everything working correctly except the lcd shield.  When I power up, the display turns on and reads correctly, but it continuously changes positions.  Only the reset button stops it, reboots, and starts cycling steps again.



#436 MonteWilson

MonteWilson

    Sputnik

  • -----
  • Vendors
  • Posts: 33
  • Joined: 21 Aug 2020

Posted 06 April 2025 - 02:34 PM

I've built a total of 3 variations of this controller, the latest tweak is incorporating an i2c 2004 lcd display and a temp/humidity probe in place of the temperature probe, the other 2 are vanilla stick and box versions.


In all variants I'm using a Nema 17HS13-0404S-PG27 and have a question.
I'm using the official nano motor shield on the stick, and a diymore deek-robot l298n rev 3 shield (cutting sense 1 to free up the lcd analog) on the full-sized version.


The videos I've seen of the nema motors show they're not particularly noisy motors. All of mine make an audible clunk per step, and buzz momentarily once completed movements, compounded by the resonance of the tube, turning my OTA into a windchime, or a horn sounding instrument...


Holding the motor you can feel it going cuchunk cuchunk cuchunk.


Is this normal? Are your nemas noisy or quiet?


I've used a 12v 3a wall wart psu, measuring a constant 12v at the motorshields power in.


I've triple (over a dozen times actually) checked step order and shaft rotation, pin allocation in code and pin outs to the shield.


I've seen that engaging the nema coils can result in high current draw, as it fights the pull of the magnets to get a rotation started, is this the issue? Are my motors too strong?


Again, a lot of videos show the nemas making a whine instead of this thump, have I done something incorrectly?

I've run into similar issues. From what I can gather around the internet the L298 driver is a bit out of its league for driving these motors. I am tempted to try a TB6600 driver board which has current limiting ability. It also uses pins 3, 11,12,13. 


Edited by MonteWilson, 06 April 2025 - 03:05 PM.


#437 tiddler

tiddler

    Explorer 1

  • -----
  • Posts: 70
  • Joined: 31 Aug 2008

Posted 06 April 2025 - 11:54 PM

Based on the Nema 17HS13-0404S-PG27 motor spec, each phase draws 0.4A. 
Electrical Specification
Manufacturer Part Number: 17HS13-0404S-PG27
Motor Type: Bipolar Stepper
Step Angle: 0.067deg
Holding Torque without Gearbox: 25Ncm(31.2oz.in)
Rated Current/phase: 0.4A
Phase Resistance: 27ohms
Inductance: 28.5mH ± 20%(1KHz)
Insulation Class: B 130°C[266°F]

 

Connection
A+        A-          B+     B-
Black   Green    Red   Blue

That is well within the 2A spec of the L298 driver chip.  




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