PICfocus telescope focuser V4.09Features:
Designed for 5 momentary pushbutton inputs (4 hand controller +1 limit switch) and a 4-coil unipolar stepper motor. The gear ratio is assumed to be between 3:1 and 5:1 from the telescope focus knob gear TO the stepper motor shaft. Switches are assigned to PIC port A as follows:
A3: PRESET button A2: MODE button A1: OUT button A0: IN button
Port B controls the stepper coils and feedback LED:
B1: coil2 (via darlington driver) B2: coil3 (via darlington driver) B3: coil4 (via darlington driver) B4: LED (through 220 ohm resistor in series with a variable resistor for dimming control) B5-B7: auxiliary outputs (B6/B7 can also be used for in-circuit programming)
The hand controller has 4 buttons, and using different combinations gives different functions. In addition, all inputs from the hand controller can be diode-OR'd with Parallel port inputs from a PC, using Mike Gray's PICFOCUS program and AstroSnap for remote PC and autofocus control respectively.
A0=AstroSnap IN control
| |||||||||
|
|||||||||
focusIN at 10 steps per second (astrosnap rate)
|
|||||||||
focusOUT at 10 steps per second (astrosnap rate)
|
|||||||||
focusIN single step per press
|
|||||||||
focusOUT single step per press
|
|||||||||
focusIN fast at 50 steps per second
|
|||||||||
focusOUT fast at 50 sps
|
|||||||||
cycle mode (1-6)
|
|||||||||
store preset (n)
|
|||||||||
recall preset (n)
|
|||||||||
reset
|
|||||||||
reboot (erase settings)
|
|||||||||
|
From PC control, you can also set output bits PB5, PB6, and PB7 to control other accessories via the parallel port. This could be used for bit control of a 74LS138 1-of-8 decoder, or simply 3 independent control lines for simultaneous use. An alternate mode for these is RC hobby servo control, where 1 or 2 servos can be controlled directly by the PIC. PB5 and/or PB6 are used for servo outputs in this case, leaving PB7 (and either of PB5/PB6 if unused)still available for bit control mode. On power-up or reset, these 3 bits are all set to 0. To use these modes, send data nibble sequences out the 4 parallel lines as follows: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Note that there is NO "end" signal nibble to terminate serial nibble comm. ***IMPORTANT:*** sending any subsequent command data or pressing a button on the handbox will automatically halt an active servo (i.e. - changing the status of PB7 via a port output mode command will turn off any servos).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Servo control byte format is as follows (designed around futaba S148 hobby servo):
0-255 = pulsewidth between 600uS and 2.4mS to give full servo motion range. Note
that a servo modified for continuous rotation will associate this with speed
control where 0-127 is fast-to-slow in the counterclockwise direction and
129-255 is slow to fast in the clockwise direction. The value of the "center zero"
point around 128 will depend on the servo and its modification. The timing for this "serial nibble exchange" is 30mS per nibble. Upon first time power-up, the PIC Is set For half-STEP, constant-power mode, AND the LED lights steadily to indicate that the user must manually move the focuser to the "maximum out" position that they want accessible by the stepper (before the focus tube falls out and causes you grief). Once the focuser is manually moved to this point, press the PRESET Button. The motor will begin to step inwards until it reaches the ZERO point limit switch. It then memorizes these positions as maxpoints, and stores the reference so presets can be stored in EEPROM. Following this (once it reaches the zero point), it will await keypad/computer commands. After the first time powering up, there is no need to move the focuser out to the maxpoint, as it is stored in EEPROM. Subsequent power-ups will move the focuser in until the ZERO limit switch is activated, then will proceed to preset#1 and await further commands. After 3 seconds of no commands, the PIC will automatically power-down the stepper coils to preserve power, if the pic is in mode 4,5,or 6 (modes 1,2,and 3 are constant power). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||