SGL Focuser Getting Started
SGL Focuser Getting Started
Introduction
SGL Observatory Automation is an open source project to control the creation of software,
hardware and interfaces to automate an astronomical observatory using the Arduino open standard,
with ASCOM support for appropriate devices.
This guide deals with the Focuser Control part of the project. This allows you to control your DIY
motor focuser via the ASCOM standard or via a stand-alone Windows application.
A bipolar stepper motor with 1.8 degree steps / 200 steps per revolution or better
(less degrees / more steps are better)
One of the supported stepper motor driver circuits
One Arduino micro controller board
- Software
o
- Skills
o
Mechanical skills to mount the stepper motor onto your telescope focuser model.
This can be done in many different ways and depends on your specific focuser
model.
Some soldering will be required. Some of the circuits of this project are quite small
and sensitive; specifically the Arduino and the EasyDriver. If your soldering skills are
a bit rusty or lacking, then I recommend practicing on something less sensitive first.
The Hardware
Overview
This is an overview of how everything needs to be connected
The connection between the PC and the Arduino is a simple USB cable. The Arduino will be powered
from the USB bus. The stepper driver connects to the Arduino via a few signal lines and a Ground
line (GND). The wires coming out of the stepper motor then connect to the driver board. The power
supply for the stepper motor also connects to the driver board.
The Arduino can be any reasonably modern model. The Arduino Duemilanove (Italian for 2009), Uno
and Mega are popular. I personally have chosen an Arduino Nano because its quite small but has
the same functionality as the 2009. If you have not dealt with an Arduino before, I recommend
having a look at the Arduino website http://arduino.cc and get an idea what it is all about.
As for the driver, 3 types are supported: the EasyDriver board, the L293 driver chip and the LadyAda
AFmotor board.
I personally have only used the EasyDriver, so I will concentrate on this driver
from now on. The procedure will be different for other drivers.
The stepper motor should be a bipolar stepper motor with 1.8 degrees per step (less is better).
Thats the equivalent of 200 steps per rotation (more is better). The stepper can have 4 or 6 wires
but only 4 will be used. These steppers can be salvaged from old printers for example. You can also
find some cheap ones on Ebay. You can ask on the Yahoo! Group if you are not sure whether a
particular stepper will be suitable.
The power supply depends on the stepper. The EasyDriver can handle up to 30Volts. Go a little
higher than what the stepper is rated for. That will make sure that the stepper has enough torque to
turn the focuser. Im using a 12V power supply for my 5V rated stepper.
Connecting everything up
On the Arduino side you need to connect 3 wires;
wires; one on a GND pin and 2 on digital I/O pins. The
default I/O pins are pin 2 for direction and pin 3 for step signals. You can choose different pins and
specify the pins you used in the Arduino sketch later.
These 3 wires go to the EasyDrivers DIR, STEP and
a GND pin. Then connect the stepper power supply
to the EasyDriver. The 4 wires of the stepper motor also connect to the EasyDriver. More on that
later.
This is what it should look like:
The 6 wire stepper is a little more tricky. You will need to measure the resistance. Continuity is not
enough. You need to find pairs with higher resistance than other combination of wires. In the
diagram below there will be higher resistance between A and A than between A and A COM
(because the coil is longer). With this type of stepper you will not use A COM and B COM.
Once you know which wires are pairs, connect one pair to the A terminals on the EasyDriver and the
other pair to the B terminals.
And one with a direct coupling onto the shaft (commercial item):-
The Software
Installing the Arduino Software
You can skip this step if you already have the Arduino Software installed from a different project.
The Arduino Software is an IDE (Integrated Development Environment) that runs on Windows, Mac
OS X and Linux. This is where you would develop software that runs on an Arduino and it is also used
to upload the sketch onto the Arduino.
For this project the Arduino Software will only be used to make small source code modifications and
then upload the sketch to the Arduino board. It is not required when using the focuser. Therefore
you dont need to install it on the same PC that you will use to control the focuser. It is, of course, no
problem to install it all on the same machine.
First you need to download the Arduino Software from here:
http://arduino.cc/en/Main/Software
Then install and configure the Arduino Software. This is explained on the Arduino website here:
http://arduino.cc/en/Guide/HomePage
Feel free to follow the examples provided on the Arduino Website. The blink example sketch is a
good and popular way to check if everything is set up and working correctly.
Make sure that the Arduino Software is not running while you copy the libraries. If it was running,
then close it and start it again for it to recognise the new libraries.
click the Upload button. This will compile the sketch into binary format and upload it to the Arduino
board. When the upload has finished the Arduino will start running the sketch immediately.
If you get any errors at this stage, check on the Arduino website for a solution and/or ask for help on
the Yahoo! Group.
Now select the COM port that is assigned to your Arduino board and click Connect. Then enter a
value in the field above Set Steps. 100 is a good starting point. Then click Set Steps and then on Set
Relative. Now when you click on In or Out the stepper should make the number of steps in that
direction. 100 steps is probably a very small movement. To make bigger steps, enter a higher
number and click Set Steps again.
If the stepper is moving and does so in the right direction, then youre done. The only thing left to do
is to install the SGL Focuser ASCOM Driver if you want to use that.
If the stepper does move but in the wrong direction, i.e. the focuser moves out when you click the In
button, then you can correct for this in the Arduino sketch. Close the Stand-alone application (for it
to close the COM port) and load the sketch into the Arduino Software again. (see Modifying and
Uploading the Sketch).
In the sketch find the following line
boolean Direction = true;//True is one way false is other.Change to
false if motor is moving in the wrong direction
Change it to
boolean Direction = false;//True is one way false is other.Change to
false if motor is moving in the wrong direction
Then upload the sketch to the Arduino board again. . (see Modifying and Uploading the Sketch).
Now close the Arduino Software again and start the Stand-alone application and test again. The
stepper should now move in the opposite, correct direction.
If you experience any other issues at this point (for example the stepper is not moving at all) please
ask for help on the Yahoo! Group.
Good luck with your build and clear skies for actually using it.