tizianoniero.it Solar system HiRes images

Focuser hardware

Stepper motors are relatively easy to use and particularly useful in projects which need a good and cheap positioning. Their main disadvantages are vibrations when driven in full-step and the lack of absolute position. We can overcome the first by using micro-stepping and the second by performing a "zero search", i.e. moving the focuser intra-focal until a tactile micro-switch is pressed. That position is the "zero" and then just counting the steps let we have the absolute position. If you know how many steps are needed to complete the focuser course you can calculate the step size, for example in microns.

In my project the focuser stepper motor is controlled both remotely by a PC and locally through a keypad. To perform both I used an Arduino Micro board which is connected through a micro-USB cable to the PC. Some board's GPIO pins are used to send the DIR/STEP/ENABLE signals to the POLOLU stepper motor driver which is capable of micro-stepping (up to 32 micro-steps).
The USB cable provides also the 5V power for the Arduino while an indipendent 24V switching power supply (but 12V is good) is used to power the Pololu current driver. Please note that the Pololu can be driven from 8.2 to 45 V and can deliver up to approximately 1.5 A per phase without a heat sink thus it is surely oversized for the project. But I mean this project a "generic stepper motor driver" as it can be used with more powerful motors which demand more current to move heavier focusers. The difference in price with the "low current" models is so small, too, that choosing to oversize the final stage is not a problem but a safety. Note also that current is driven into motor windings by switching the mosfets that compose the final H-bridge stage of the driver and a current sensing mechanism is provided to mantain fixed the value of the current into the windings. You can regulate this current by a trimmer in the Pololu board. Follow the provided instructions to regulate it properly. Generally speaking if the motor seems too weak when moving then you must provide more current to achieve more torque.

It is important to note that keeping energized the motor windings when the motor is stopped has two important drawbacks: the motor is locked to its position and manually moving the focuser knob is difficult as the motor torque is high; also the motor and the current driver heat and wast power for nothing. For this reason when in idle state, i.e. not moving, the current driver outputs are kept in three-state by setting HIGH the Arduino pin D8, connected to the ENA/ Pololu input. Thus when in idle state the motor shaft is keft free to rotate and the user can move manually the focuser knob. However in this case the absolute position is lost. For this reason it is useful the keypad by which the user can change the focus without losing the absolute position counting.

Another project feature is the possibility to change the number of micro-steps for full step. This can be done through the Arduino pins D9 to D11 connected to Pololu pins M0 to M2. Possible values are 1 (full step), 2 (half step), 4, 8, 16, 32 (default value, which allows the smoother movement).

Below is the fritzing schema of the connections. Click it for a closer view.
focuser fritzing

Pin connections

In this first version I choose not to use interrupts for digital inputs from the keypad push buttons. In Arduino Micro these are pins 0, 1, and 2. Instead I used D2 to D11 for digital IO and A5 for reading the analog voltage from the NTC.
In detail:

  • D2 is the input of the limit switch, internally pull-up (it's a Panasonic low profile tactile switch from RS-Italy, code RS 392-1562)
  • D3 is the input of the keypad push button intra-focal, internally pull-up
  • D4 is the input of the keypad push button extra-focal, internally pull-up
  • D7 is the input of the keypad push button which toggles the speed (slow / fast), internally pull-up
  • D5 is the output of STEP signal for the Pololu
  • D6 is the output of DIR signal for the Pololu
  • D8 is the output of ENABLE signal for the Pololu
  • D9 is the output of M0 signal for the Pololu
  • D10 is the output of M1 signal for the Pololu
  • D11 is the output of M2 signal for the Pololu
  • A5 is the analog input of the resistive divider made with a 10KOhm resistance and a 10KOhm NTC (it's a 10 kΩ ±0.9 %, 10 s, from RS-Italy, code RS 151-237).

Pololu pins RST/ and SLP/ are connected to 5V (Arduino); GNDs of Pololu and Arduino are connected togheter. Pololu pins A1-A2 and B1-B2 are connected to the stepper motor.

IMPORTANT NOTE: as reported on the driver reference be sure to connect the electrolytic capacitor (100µF) between VMOT and GND on Pololu motor power supply pins in order to avoid voltage spikes that can damage the driver.

Stepper motor

If you have a bipolar stepper it has only 4 wires; check it with an ohmeter: the wires that are not open circuit belongs to a winding, the other two to the second winding. An unipolar motor has usually 6 wires: let we call A, B, C the three connections of one winding and D, E, F the three connections of the second winding; let it be A and C the terminal points and B the central, the same for D and F, E the central one; according to what described in Pololu driver reference the terminals to be used are A and B for one winding and D and E for the other (or , it is the same, B+C and E+F). This is for the better motor performance in conjuction with the current driver. You can find these terminals as they are the ones which have the less resistance between each other: for example if A - C resistance is 70 ohm then A - B or B - C are 35 ohm (about).