Simcoe Skies Astronomy

PICfocus Electronic Focuser - Operation

PICfocus telescope focuser V4.09

A fine-control electronic telescope focuser capable of stand-alone (local) and remote PC control.

Features:

  • 10 preset locations stored in non-volatile memory
  • fast, slow, and single-step movement controls
  • autofocus capable with an astrocam and AstroSnap software
  • high-resolution, normal resolution, and hi-torque step modes
  • power conservation option to power down motor coils after 3 seconds of inactivity
  • firmware upgradable with in-circuit serial programmer & PC software
  • "aux" function via PC to control 3 output lines directly or 2 hobby servos (for control of other accessories on PB5|PB6|PB7)

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:
    A4: full-in limit switch
    A3: PRESET button
    A2: MODE button
    A1: OUT button
    A0: IN button
Note: The presence of the limit switch IS required for operation, as without it, there is no reference for either the outer safety limit or the preset. All switch input pins of the PIC have a 10k pulldown resistor. Switches are active high.

Port B controls the stepper coils and feedback LED:

    B0: coil1 (via darlington driver)
    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 stepper coils are connected and gearing is oriented so that sequencing coil 1-2-3-4 steps the focuser in the OUTWARDS direction.



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.
    A1=AstroSnap OUT control
    A0=AstroSnap IN control

Functions:

focusIN at 10 steps per second (astrosnap rate)
  • press IN button
focusOUT at 10 steps per second (astrosnap rate)
  • press OUT button
focusIN single step per press
  • hold MODE while single-pressing IN button
focusOUT single step per press
  • hold MODE while single-pressing OUT button
focusIN fast at 50 steps per second
  • hold MODE and press IN for >1 second
focusOUT fast at 50 sps
  • hold MODE and press OUT for >1 second
cycle mode (1-6)
  • press and hold MODE for 10 seconds
  • LED will flash (n) times to indicate mode 1-6
Modes are as follows:
  1. half-step constant-power mode (high resolution)
  2. single-step constant-power mode (normal resolution)
  3. dual-coil constant-power mode (normal resolutin, hi-torque)
  4. half-step power-saver mode (high resolution)
  5. single-step power-saver mode (normal resolution)
  6. dual-coil power-saver mode (normal resolution, hi-torque)
store preset (n)
  • press and hold PRESET button, wait for LED to flash (n) times & release
  • press and release IN button - LED will turn on steady as an "are you sure?"
  • press and hold IN button for 2 seconds to store (LED stays on for this time)
  • LED will turn off to confirm stored
  • release IN button
recall preset (n)
  • press and hold PRESET button, wait for LED to flash (n) times & release
  • press OUT and hold BRIEFLY (until LED starts to flash)
  • LED will flash (n) times to confirm it's moving to preset(n)
  • stepper will move to the preset location
  • LED will flash (n) times AGAIN, to indicate arrival
reset
  • press and hold IN and OUT at the same time for 3 seconds (stepper will move focuser in until limit switch is activated, and then return to preset 1)
reboot (erase settings)
  • press and hold PRESET and MODE at the same time for 3 seconds (LED will turn on to prompt user to move focus to desired MAXOUT point ~ then press PRESET to continue ~ stepper will then move the focuser INWARDS until the limit switch is activated)


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:
for BIT output control mode
D3D2D1D0
1111 - enter port output mode (decimal 15)
0000 - bit output mode (decimal 0)
X765 - bits to output to PB7, PB6, PB5

for SERVO control mode
D3D2D1D0
1111 - enter port output mode (decimal 15)
001X - servo output mode, servo select bit (decimal 2=PB5, decimal 3=PB6)
XXXX - most significant nibble of servo control byte
XXXX - least significant nibble of servo control byte

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).

overview | motor mounting | electronics assembly | schematic | PIC program | HEX code | PC program


back to main page