ASCOM Parallel port based stepper for focus and gameport thermistor for temperature compensation.
This PPT focuser was fully derived from the Focuser Simulator source distributed with ASCOM platform.
It adds one more API to the ASCOM list, namely “do_tempcomp()” so an external program can cause a temperature based focus compensation check and execute. This was done because image shift in an SCT when using the stock focuser knob can ruin an exposure if temp compensation is allowed to happen asynchronously with imaging.
The program supports a unipolar stepper motor connected to pins 0 through 3 of the LPT port (currently limited to only these pins) and provides for temperature reading and temperature based focus compensation by attaching a thermistor to pins 1 and 3 of a PC gameport.
This current version, 4.0.0 only supports PPT bits 0 through 3 wired in that order.
It can drive a unipolar stepper in wave fashion or half-steps forward or backwards. It can drive a bipolar stepper in wave fashion.
Utility driver for direct hardware access
How well does it work: Focuser?
How well does it work: Gameport temperature?
The bits of the PPT port are accessed directly by the driver and require the utility program inpout32.dll, get that here and drop into you windows/system32 directory
The version is 1.0.0.1
My stepper came from an old Mustek scanner. It provides for 7.5 degree/step. The scanner also contained a gear with a center hole size that I could tap to ½-20 threads and replace the lx200 focuser handle directly. The gear reductions provide for 560 steps/rotation of the focus shaft. The scanner also contributed a stepper driver darlington array. Total parts count is 1 PPT cable, one stepper, one gear and 1 darlington array.

The program supports hooking up a thermistor to gameports pin 1 and 3 and using this to read the temperature.
The pinout of the gameport and more info is available here:
The program requires you to supply the response of the gameport to various resistance values. To calibrate your gameport port for use in the program:
Go get this program
and record the raw values when you use some widely separated resistor values between pin 1 and pin 3 of the gameport.
(Below are from my gameport)
47k = 18744
33k = 13049
22k = 8939
11k = 4794
10k = 4361 (for my thermistor this is R value at 25C)
Calculate the slope and intercept of the line (again, mine below)
Y = mx + B
Y = 2.5886x - 1227.9
Y = resistance
x = raw value from gameport reading

Note, with a gameport, you need to have a dummy load of <100k ohms in the Yin pin also. I suggest a 10k ohm load.
The pins required are
Pin1 = 5V--+
|
Thermistor or calibration resistor
|
Pin3 = Xin-+
Pin6 = Yin, connect to pin 1 through <100k resistor
Since the program supports the Steinhart-Hart A, B and C coefficients directly you do not
need a linearizing resistor. I use a (no longer available) RadioShack 10k thermistor part number 210-110A.
Not sure I would use a low value thermistor without a linearizing resistor because of self heating, but then since it will be attached to the scope tube, the tube is a pretty big heat sink!
For info on thermistors, see the bottom of my page:
Themistor references at bottom of my Meade DSI cooling page

|
Position |
Current position |
|
IN |
Move focuser ‘in’, no backlash comp |
|
OUT |
Move focuser ‘out’, no backlash comp |
|
Manual steps |
# steps to move if ‘in’ or ‘out’ pressed |
|
Temp |
Currrent temperature, F or C based on ‘setup’ page setting |
|
Allow Temp Compensation |
Allows for temperature compensation via API |
|
Allow Auto Temp Compensation |
Program will auto focus based on temperature give parameters on ‘setup’ screen. |
|
Setup |
Go to the setup screen |
|
Traffic |
Allows monitoring varius internal info and ASCOM traffic |

|
Maximum Position |
If in Absolute mode, the current position |
|
Step Size |
Not really used internally |
|
Maximum Increment |
The max # steps in any one move command |
|
Step Time |
The time in milliseconds between steps 20ms = 50 steps/second |
|
LPT address |
The port address for the LPT. Accepts hex or decimal. 888 = 371H |
|
Absolute |
Position is absolute, from 0 through Max Position |
|
Relative |
Position is relative, there is no Max Position available in this mode |
|
Reverse Direc |
Normal stepping is A, B, C, D. Reverse will do D, C, B, A |
|
Half Step |
Drive stepper in half steps (valid for unipolar) |
|
Temperature Probe |
A thermistor is hooked up to the gameport X axis input |
|
Temperature Compensation |
Allows for temperature compensation. Actual application of compensation is controlled by the handbox screen |
|
Step Size |
Not used internally |
|
Apply Backlash on Temp Comp |
If checked then apply backlash when temperature compensating. |
|
Backlash Dir = IN |
If checked then if moving IN for compensating then apply backlash. If not checked and backlash enabled the apply backlash on moving out. |
|
Halt |
Not implemented - yet |
|
Current Temp |
The current temperature |
|
Delta T |
Amount of temp shift to see before apply compensation steps |
|
Steps/Delta T |
# of steps to move if Delta T temp change |
|
Centigrade |
If checked then work in C, else work in F |
|
Comp backlash |
If temperature compensating and backlash enabled, apply this # steps for backlash |
|
# readings to average |
Program reads temp every second. This is the number of reading to take to find the average temp. 60 = 60 readings then calc average fo those 60. Min =1 max = 300 |
|
Joystick Calib M(slope) |
The slope of the curve fit to gameport readings calibration |
|
Joystick Calib B(intercept) |
The intercept of the curve fit to joystick readings calibration
|
|
Steinhart-Hart A |
A coefficient of the Steinhart-Hart equation for thermistor |
|
Steinhart-Hart B |
B coefficient of the Steinhart-Hart equation for thermistor |
|
Steinhart-Hart C |
C coefficient of the Steinhart-Hart equation for thermistor |
On my lx200 surprisingly well. I have what seems to be full repeatability moving in -or- moving out. My focuser does exhibit backlash and the backlash compensation takes care of it.
Using the gameport to read a thermistor: there are many articles on the web about using the gameport to read sensors. I have found that with my PC, after applying the gameport calibration above, the repeatability and accuracy is quite good. I use F readings and single samples are within +/- 0.5 degree F of each other. When average over 60 samples (1 minutes worth), the repeatability is +/ 0.1 degree F. As far as accuracy goes, I did a lot of work on the thermistor coefficients when I built the peltier power control for my DSI.
See the bottom of my page:
Thermistor info at bottom of page
The A, B and C of the Steinhart-Hart equations change based on the temperature range they are calculated for. I use ranges of 32F through 75F and 0F through 32F. All in all, compared with two other digital thermometers, the accuracy is +/- 1 degree F from 25F through 75F, being at the upper end of the range of deviation below 40F (hence the need for different A, B and C).