Temperature controlled focuser, Design and Software.
Features:
Get the plans, schematics, and source code.
This focuser cannot be used with autofocus routines such as MaxIm-DL or the FocusMax Autofocus Software until an ASCOM driver is written (which I am currently working on). I personally control the focuser using the LX-200 command set.
The heart of the focuser is a $49 Parallax Basic STAMP II "Computer on a chip" module. Software for programming the module and documentation are free on the web site.
The focuser uses a simple linear function to focus based upon the temperature and a pre-calculated zero point. These data are stored in the STAMP module even while powered down. The slope parameter must be entered directly into the program; the zero-point is recalculated and stored every time a focus position is saved as good.
The focuser can be controlled by a handpad; when the focus is acceptable, press the "save" button (if the save button is not pressed, the focuser will resume using the prior focus data after about 90 seconds). At this point a new zero-point for the temperature is calculated and saved. The temperature reading and focuser positions for the night are also saved in the STAMP's internal non-volatile memory, so that it can be recovered and analyzed.
The focuser can also be controlled by a computer; two signal lines plus a ground line are used. There are two signal types supported: one line sending a focus pulse with the second line specifying the focus direction, or one line for pulses in and the other for pulses out. In either case signal pulses should have a duty cycle of at least 0.3 seconds to insure pulses are not missed.
A crude circuit board layout is included. It works for me, but I make no guarantees. Certainly the stepper motor wires will likely be connected differently for your motor, as well as the optical sensors for the initial zeroing of the focuser position. The board uses a Radio Shack thermistor and an A9665 high voltage, high current Darlington transistor array IC (equivalent to Motorola’s MC1413, B and National Semiconductor’s DS2003) to drive the stepper motors. The circuit can easily be modified to use discrete transistors. Just make sure they can handle the voltage, voltage spikes generated by the stepper's inductive windings, and the amperage. A 7805 voltage regulator is also used. Resistor values are not very critical. I got my stepper motor from an old floppy drive; I was also able to use some of the stepper mounting hardware to attach it to the focuser.
Mel Bartles' motorized Dobsonian telescope design page has good information on hooking up a stepper motor and circuitry for driving them if you would like to change anything. You will need a 5 or 6 wire stepper; connect the coil center wires to +V, and the other four to the A9556 IC outputs. The easiest method to get the connections correct is to just try them until the motor turns smoothly when you turn on the focuser (with the optical stop open). Alternatively you can adjust the order of the values in the array of stepper values in the program. Don't change the numbers, just their order in the array.
First-time use: Decide whether you will use the computer-interfaced capability. If so, you will need to know if the software will communicate with the focuser with a "step" signal and a "direction" signal (if so use the program "STAMP focuser Computer Pulse and Direction.bs2"), or a "focus in" and "focus out" signal (use the program "STAMP Focuser Computer In And Out.bs2"). If you will not use the computer to focus, it does not matter which program you use. Download the program to the STAMP module using the focuser's serial port and the Parallax software.
I epoxied the optical emitter/detector and knife edge sensor to the focuser so that the positioning is reproducible from night to night without an initial manual or computer focus. You can add this either before or after calibrating the focuser.
The first time you will need to collect data to calibrate the focuser. You can leave the temperature compensation on while doing this if you want, but it is very unlikely that this will be even close to accurate; in fact there is a 50-50 chance it will correct in the wrong direction! Rather than fighting the temperature compensation it is easier to set the jumpers on the board to disable the temperature compensation (IO pin 13 open and IO pin 14 closed). You will get the same data either way.
Turn the unit on. It should move until the optical stop is reached. If no sensor is attached, it may or may not stop immediately (it depends on the specific sensor). If it doesn't stop, or doesn't start, change the line in the code which reads " if IN0 = 0 then MoveToStop" to " if IN0 = 1 then MoveToStop" (You are changing it to loop when the voltage is +5 rather than 0.) If it moves in the wrong direction, you must either rewire the stepper motor or change the "StepIndex = StepIndex +1" to "StepIndex = StepIndex – 1" BOTH places in the code paragraph following the label "MoveToStop."
Now focus using the hand pad. When you are satisfied with the focus, press the "save" button. The program will save the temperature and step position in the STAMP module for later readout. Keep on doing this throughout the night. The bigger the temperature change, the more accurate the focusing will be. Try to get at least 10 degrees F; 20 or more is even better. You can save about 75 data points.
When you are through, turn off the focuser. Remove both of the jumpers, and connect the serial line on the focuser to your computer. Run the STAMP programming program on the computer, and set it up to receive debug data. Turn on the Focuser. Each time you press the Save button on the handpad, a temperature/stepper position data point will be downloaded. Put these data into a spreadsheet, and run a linear regression of the data. (In recent Excel versions, make a graph, and add a trendline. Do not force the line through zero. Have it also show the equation for the line). You will need to put the slope into the STAMP program and download the newer version to the STAMP module. Note that the STAMP only does integer math; there is a discussion of this in the manual 1.9 on pages 231-234, and especially with the */ operator on page 242. My setup needs a slope of about 0.043, so I divide by 23 and multiply by 1. By adjusting the values of the mult_factor and div_factor in the program, you can get very close to what you need. To take care of the sign, it is easiest to change the following lines in the program. The program is currently set up for a negative slope.
About 10 lines past: "' move to focus based on temp"
calc_position = zero_pt - calc_position ' change "-" to "+" for pos. slope Also, farther down the code: 'back calculate zero position zero_pt = temp * mult_factor zero_pt = zero_pt/div_factor + currentposition ' change "+" to "-" for pos. slope
Make these changes to the focuser software, and download the new program. Close both jumpers on the focuser board, and you should be ready to go.
When using a computer to focus, rather than using a fourth wire to "save" the focus position and reset the zero point, the program waits about 90 seconds. If there have been no changes in focus position from the computer or hand pad in this time, the program assumes the focus is good and saves it.
I have found this program to work very well; I can now go a whole night without focusing. However, it did take a few tries to get the slope parameter correct.
Let me know if you find any problems or bugs so I can fix them. This focuser and program is very flexible, so feel free to change it to match your needs. If you have any problems, I will help you as much as I can; contact me at jmcclusky@tlu.edu.
I make no claims about the suitability of the focuser and software to your uses or telescope, or even that it will work at all. The focuser may destroy your telescope and computer, even if you do everything just as I suggest in these plans. I do claim copyright on its design and the program. I do not give permission to produce or sell focusers based upon this design or software.