Help. Stuck with Arduino based telescope focuser.

Hi. I am trying to build a DIY telescope focuser. This is just a stepper motor, an Arduino Uno and a motor shield. This is my first experience with an Arduino project. I have lots of experience with computers, some electronics, and no coding. A contributor on astronomyforums.net was helping me through this but that forum has died and I am stuck on editing the Arduino sketch for this focuser.

I have the Arduino IDE and the sketch downloaded from SourceForge. There is also an eepromanything.h file that is supposed to be included with the sketch. I don't know how to do that. The eepromanything.h file does not download, it just displays a small batch of text when I click on it in SourceForge. Do I copy this into the main sketch in the Arduino IDE, or does it have to be a separate file that is downloaded to the Arduino with the main sketch?

Lots of simple details but to a beginner even a tiny missing step is huge.

Appreciate any help with this. Thanks a bunch.

DonM

Lots of simple details

. . . are missing from your post.

You need to provide a lot more information if we are to be able to help you.

First, perhaps explain what is meant to happen - ie what does the motor do and how does it know what to do? How does it know when it is focused?

Post a link to the datasheet for the stepper motor you are using.

Post the program you are trying to use.
Post a link to the web page where you got the program.

...R

You have to download the entire project from SourceForge. See the .zip download button there, download and unpack the archive into your sketch folder.

You forgot to say WHICH of the thousands of projects on SourceForge you are trying to use.

I think people get the wrong idea for how electronic projects work. They are not like kits: buy the parts, and follow the instructions - then voila! you have the thing!

It is instead a learning journey: investigate the variouys parts and how they interact, develop (or grab off the net) a project using the parts you have been exploring, and voila! You have the next step in the journey.

Perhaps Stargeezer (clever name!) if you are still reading this, you should start with learning about the stepper motor and Arduino interaction. If you have a partial sketch for your focuser, post it here (read the ‘How to use this forum’ post first though!) and folks will fall over themselves to help you out with the coding (and hardware) parts of your project.

Hi. Sorry for the lack of info. As a beginner I get hung up on details. My specific concern is what to do with the eepromanything.h file. It only exists as lines of code on the Source Forge web site. I can copy this code and paste it into a Word File and save it as plain text. I imagine that the file has to be .txt to work? Other comments I have received say that this file has to be in the IDE library. Is this where it should go, rather than copying it into the sketch directly?

Just for further info, this project is a simple stepper motor controller that will drive the focus knob on a telescope. It will connect by a USB cable to a powered USB hub and then to a high speed router that I can connect to in the house. I am getting too old to stand out at the telescope in the winter. The video camera, control of the telescope mount, and the focuser will all be accessed by wireless control from my desktop computer, I hope.

I am using an Arduino Uno and an L293D motor shield. This is the sketch recommended in my instructions:

https://sourceforge.net/projects/arduinofocuscontrollerpro/files/CODE%20ARDUINO/L293D_M/

This is the eepromanything.h that is recommended:

The stepper will be controlled by a software app on the desktop computer such as this:

https://sourceforge.net/projects/arduinofocuscontrollerpro/files/CODE%20WINDOWS/Mini%20App/

Or a commercial package using an Ascom driver here:

https://sourceforge.net/projects/arduinofocuscontrollerpro/files/CODE%20ASCOM/

I have put some study into this and am learning a lot. It seems like a good introduction to the Arduino, but I have some simple points that I am hung up on.

Thanks for the comments.

DonM

Hi. Should have listed the overall description page for this project:

DonM

Hiya Don,

The Uno and shield should work fine, although I don't know what motor you are driving. I have experience only with the small 28BYJ-48 steppers. You will want to configure it as a bipolar motor with that stepper. Here is a good introduction to stepper motors.

As far as installing and including a library, read up on them here. A library is a file containing code used by your sketch. The code is compiled right along with your sketch. Include it by placing the file in the Libraries directory (ie folder) in your Arduino directory, and using the keyword #include.

When you copy, paste and save the code from the website, name the header file with a suffix of .h and the code file with .cpp as it's suffix. Your sketch, of course should stay as a .ino file. The instructions on the website where you found the code should indicate which file is is which type.

Perhaps start by setting up and running the stepper motor examples that are in the IDE.

Thats got to be the one of the worst repositories I’ve ever seen… even by sourceforge standards. Usually you can expect to find a link that will download a zip file with all the files included and laid out in a directory structure already. This is a twisty mess.

I guess you are using code from one of the sub-directories under the “CODE ARDUINO” folder. You need to copy the file eepromanything.h to the same directory as the ino file. It has to be named “eepromanything.h” without .txt or any other any suffixes.

In the code you can see two slightly different include lines.

#include <EEPROM.h>   # <> means file is found in a library directory somewhere
#include "eepromanything.h"  # "" means file is found in same directory as source code.

Hope this helps

Ok, I copied the eepromanything file into a simple text file and saved it to the sketchbook location as a .h file with the .ino file for the focuser. The help files in the Arduino IDE are great for the initial setup of the Arduino. The Windows program for the focuser does all the other settings. I have the stepper motors ordered from Amazon. Just a bit doubtful about the libraries that were recommended to me by a fellow who had built this project. He was on astronomyforum.net which has crashed so I can't get back to him. I have sent a question to Robert Brown, the author of the project for confirmation.

One question on the 28BYJ-48 stepper. I ordered a bunch from Amazon. The data in the ad lists a step angle of 5.625 with a 64:1 reduction. That means that the number of steps per rotation of the motor is 360/5.625 = 64 steps. The number of steps for the rotation of the output shaft is 64X64 = 4096

But the examples for this motor in the project documents, and the listing for it in the Arduino sketch, show 2048 steps. These would all be full steps since half stepping isn't allowed for this motor in the sketch.

I need to know these numbers to enter into the sketch. I lean towards the 2048 step number but wonder about the information provided with the motor

Any ideas?

Thanks
(ps, enter 28BYJ-48 into the search field in Amazon. The set I ordered is at the top of the list, the 5 stepper motor kit.)

Note: At least one version of that motor has a 283712:4455 (roughly 63.684:1) gear ratio and not 64:1.

http://forum.arduino.cc/index.php?topic=71964.15

ChrisTenone:
Hiya Don,

The Uno and shield should work fine, although I don't know what motor you are driving. I have experience only with the small 28BYJ-48 steppers. You will want to configure it as a bipolar motor with that stepper. Here is a good introduction to stepper motors.

So these motors are 5 wire. How do you configure them as bipolar motors? Just attach the 2 coil wires on each phase and ignore the common wire? Does that work given that both phases are joined by the common 5th wire?

DonM

Hi again Don,

Yes, you can just hook up the four coil wires and ignore the red common wire - just leave it flapping in the wind, or clip it off. The motor works just fine, with about the same torque of the motor when run in unipolar mode with the darlington array chip. However, if you cut the wire between the two sets of coils, then the torque will at least double!

Google '28byj48 as bipolar' and you will see a dozen or more demos of how to cut that wire internally. It literally takes less than half an hour, start to finish. I found it much easier than modifying a standard servo to be a continuous rotation servo. As long as you do not need massive amounts of power and speed, the little 28byj48 motor really rocks for versatility, ease of use, and ease on the pocketbook.