A new stepper motor driver circuit (mainly) for driving equatorial platforms



A new driver concept, added 2010 Oct 15:


I bought an Arduino (Duemilanove) microcontroller for experimenting, and this is a useful application I have come up with.

It has some advantages to my analog approach – namely:


The stepper driver interface uses power MOSFETs

The Arduino code (in C++)



Further Revised 2005 Dec. 7:

A modified driving mechanism for a tangent arm drive, see end of page.

Further Revised 2004 Feb. 1:

A link to my tiny platform added, and a new picture or two of my older, larger one.

Further Revised 2003 Apr. 5:

I just learned that the PCB pattern was NOT corrected as described 2002 Dec.17 (the 1:4 version for viewing was, however) - now it is corrected, I believe. My apologies.

Further Revised 2002Dec. 17:

I have recently been warned of an error in the PCB layout: The resistors R18 and R22 that should have been connected to pin 8 of U4 were mistakenly connected to pin 9. The present versions have been corrected.

A minor error on the component layout is that there are two versions of C2, in the upper right and lower left corners - let one of them read C11 instead (they are equal). This is not corrected on the image.

Revised 2002, Feb. 23, by David H Bevel:

Revised 2002, Feb. 07, including further work by David H Bevel:

Here is the latest schematic by David H Bevel - I have updated the text with his parts numbering (I hope, but I may have missed occasionally!). This schematic, the parts list and the PCB pattern (Full scale at 500 dpi - or a 1:4 version for viewing) (note that the pattern is seen from the component, NOT the copper side!) and an alternate PCB pattern with less copper etched away, as well as the component layout and the timing diagram are mutually consistent - I am sure. Also, here is a diagram of the connections and a picture of Dave's version built and ready - Thanks a lot Dave for all the work you've done !!!!! Folks, please respect our copyrights...

Next in the pipeline - the modification necessary to use a low-voltage stepper motor using 3V supply (and 12v for the control circuit). If this is of interest to you, mail me at nilsolof.carlin@telia.com .

This circuit was designed primarily to feed a 5.25" floppy-disk type stepper, driving a threaded rod, but may be used with other platform designs. It features:

I've been using an equatorial platform for my 13.1" and 6" Dobs. I consider the platform a very useful addition - a full GoTo mount can do more, but I think the mechanical complexity is also in another league. It is of course particularly useful for planet studies - not least if you like to show planets to friends and acquaintances, as you do not need to re-position the telescope every minute! However, the full-step circuit I have been using (until I made the circuit described here) introduces enough vibration to wipe out much of the detail (particularly with my 6"), and I've been wishing for a better driver. Running the stepper faster using more gearing down might have helped, but I wanted a fast rewind with my threaded rod driver, and some 3 minutes of rewind after an hour of use was already near the limit of acceptability.

Recently I started to build an interface circuit for Mel Bartels' Scope Drive, to use with my old SP-C6 as a pilot project before trying with my Dobs (the stepper motors and mechanics are already there, and no position feedback is needed - but the gearing seems to preclude fast slewing...). Experimenting with this has already produced interesting spin-off in the form of a computer controlled tester stage for Foucault and related tests described elsewhere.

After experimenting with pulse-width modulation, it was quite clear to me that I should try a different approach (with all respect to Mel, though I admit that the pulse-width modulation he uses does work, but it is very noisy!). I attached a 3-bit (plus sign bit to decide which half of the winding to energize) D-A converter, using analog microstepping. Not quite unexpectedly, I found the motion of this very much smoother. So on to designing a circuit - it was a long while ago since I did much electronic design, but I had a lot of components left...

First some basic calculations:

My platform has a radius of appr 400 mm to the driving pin, meaning it should be moved at a rate of 2*pi*400 mm/23 hr 56 min, or 1.75 mm/minute - 105 mm for one hour of motion. The threaded rod is metric 6 mm with a pitch of 1 mm, meaning it should turn 1.75 turns/min or 0.029 turns/sec - with a 200 step motor (and no gears) this means 5.8 full steps/second. This means the stars near the celestial equator will move 15/5.8 ~ 2.6 arcsec/fullstep, far more than the resolution of the telescope at 0.7 arcsec of Dawes' limit for my 6". With my old driver I used a primitive gear of appr 6:1, giving a celestial motion of 0.4 arcsec between steps - clearly, resonances in my 6" amplified this. Vibration seems to be a common (but by no means universal) problem with full- or half-stepping drivers, judging from discussions over the ATM list.

To a coarse approximation, the position of a stepper motor is proportional to the tangent of the ratio of current through the windings - a sine/cosine drive would give a constant speed motion. This is not quite true with real motors - testing one floppy disk stepper showed the motion is fastest near the fullstep rest positions. The first implementation I tried used a ramp voltage that introduced some error in the same direction (one winding with constant voltage/current, the other getting a ramp up or down) - the new version presented here has a driving voltage that largely cancels this, thus ensuring even more smooth operation - it is absolutely silent and vibration-free in use - at least to the extent that seeing will permit. I tried to estimate the periodic error, and over 4 steps it was a slow error of something like 1/5 fullstep - or 1/1000 turn, or 1/1000 mm on the driving pin (!!), or some 1/2 arcsecond periodic error at about 2/3 second. This is pretty good in practice, as so slow errors can be compensated for by moving the eye! However, I have yet to discern any periodic movement in the dancing of the Airy disk...

So on with the planning: I wanted a reasonably simple circuit, with a minimum of adjustments needed. Programming a PROM of some kind to count out the levels seemed an attractive solution and is not out of the question, but the hassle of getting it programmed has kept me from trying this path - it is, of course, very easy if you like to use a laptop to control the motion!

So here is the result - until further modifications...

The circuit uses:

The circuit could be divided into a few functional sections. The first is the oscillator/waveform generator, with OPamps U4A, U4D and U4C, and XOR gate U2A. U4A with buffer U2A works as a comparator/switch (I have connected the gate as an inverter, meaning the plus and minus inputs to U4A are functionally reversed). The switch drives 2 trimmer potentiometers R5 and R6 that set the step rates, via resistors R7 and R8 that feed a current to the input of U4D - one section of the bilateral switch 4066 is selected, U3A for rewind or U3B for tracking. (If you do not need the rewind feature, the 4066 can be left out, and only one trimmer/resistor is needed).

U4D integrates this current, using the capacitor C3 (0.1 microF) and gives a ramp voltage (waveform B), if the output of 4070:1 is low the ramp will rise to 10/22 of half the battery voltage, then the comparator/switch flips and the ramp goes negative (the peak to peak voltage is 10/22 of the full battery voltage, later to be amplified by 22/10 - see below). The minimum period for one full step is appr. 2RC(10/22) or 0.9 RC (with the trimmer fully "on" and about 10x longer with it fully "off").

Start by calculating the full-step rate (like I did above) for your platform dimensions. Set the R8 and C3 for 1.5-2x this rate. As shown above, I need about 5.8 steps/sec so I go for max 11 steps/sec or 0.9RC=1/11: RC=0.1 sec and R8=1M, C3=0.1microF works well.

The rewind rate will have to be determined with load - at fast rates, the torque is lower and you will have to see what works. My stepper runs at 600 steps/sec at no load, and 1100 steps/sec could be a reasonable start: RC=0.001, and with C3 as above, R7=10k.

This sawtooth waveform is fed to the drivers U5C and U5D for winding pair one of the stepper motor - U4C is an inverter that inverts the waveform from U4D and feeds the drivers U5A and U5B, feeding winding pair two. You can see the waveforms in the timing diagram.

The second section is the timing logic. The gate U2A drives the D-latch U1A that divides the frequency by two. The signal from the outputs go via a diode to the gate of the power MOSFET, turning it off when the output in question goes low. This way, the windings are driven alternately. The XOR gate U2B generates a quadrature voltage that is fed to U2C that acts either as an inverter or non-inverter depending on whether the other input is high or low respectively. This input is taken from U1B that is used as a set-reset latch. At the end of platform travel, a switch connects the set input to high: this inverts the phase of the quadrature signal thus reversing the motor (inverting waveforms (F) and (G)). Also, the rewind trimmer R5 /resistor R7 is switched in (by U3A) and the fast rewind is started. Once rewound, the other switch activates the reset input for normal operation. The capacitor C5 to the set input is tied to Vcc, so the gate is set on power-up, ensuring the platform will always start by rewinding. (If you hold the end-of-rewind switch closed when you turn on the power, it will start with normal operation - this may be useful for testing).

Note the jumpers to U2C. If you find the motor runs in the wrong direction, you can correct by moving the jumper.

The output stages each consist of one opamp U5A-D driving its power MOSFET. As the MOSFET inverts the signal, the opamp negative input will act as a positive input, and vice versa. The driving stage has a gain of 22/10, meaning it will amplify the signal to full output swing! For stability, there is capacitive feedback from output to the negative input, and also filtering of the signal via the resistor to the gate (the capacitance of the gate is some 1000 pf!) - both are necessary for stability. When the gate is driven low via the diode, the MOSFET cannot turn on, otherwise it will try to shape the voltages on the respective outputs like this (second row):

The currents are the inverse of the voltages - current goes high when the voltage is driven low. In reality, at least during rewind the voltages seen with an oscilloscope are quite different due to the voltages induced in the windings. No special protection circuits are needed - the MOSFETs have built-in protection against overvoltages of either polarity.

The spare opamp U4B is used as a power/battery indicator. You could use a LED that changes between red and green when the polarity is reversed, or use 2 ordinary LEDs of different color connected back-to-back as shown. As long as the battery voltage is larger than twice the zener voltage, the power-on diode will be lit, but when the battery is low, the other diode is lit instead (I get a color indication below 11.2v with a 5.6V zener, fine for using a12v gel cell - for alkaline batteries, a 5.1V zener may be more appropriate). The reference voltage in the schematic is taken from a simple resistive divider, decoupled by a small capacitor. There is also an electrolytic capacitor (say 3.3- 10 microfarad with a voltage rating preferrably at least twice the feeding voltage). David has also included a diode CR5 and a fuse F1 for protection

There are a few 0.1 microfarad decoupling capacitors, but the integrating capacitor C3 should be polycarbonate or other temperature-stable type.

I use 12 volts to feed the circuit and the stepper motors. You could use 1.5 times the nominal stepper motor voltage and get no more power dissipation than with full-stepping at nominal voltage. The CMOS circuits are rated for max. 15 volts. I have not tried the lower limit, but I expect that if you go much below 9V, the MOSFETs may not turn fully on.

The prototype was built on a piece of perforated board with copper strips - cut with a small drill bit where needed. I like to use wire-wrap wire to connect the components and have used it extensively in the past: it will be easily wet by solder, and you do not need to add solder if you connect the wire to an already made joint. The sleeve is easily cut with a hand wrapping tool, but it is not damaged or affected by the heat of the soldering tip. The layout is a bit messy as it has been altered a bit - but it works.

If you like to try, I'd like to hear your results - and give support if needed. So far, my apologies for all that is still unclear or possibly incorrect - I will modify (and have already) the webpage as needed.

This is my platform seen from the north end (new images!) - the circuit is in the box to the east, the batteries are to the west. The threaded rod is connected to the stepper shaft with a piece of clear PVC - not easily seen. You can see the dark rewind (west) and end-of-rewind (east) microswitches, actuated by the little strip of wood on the slider. The piece of plywood with 3 screws clamps the ball bearing at the end of the rod (a small bushing fits the 6 mm rod to the 8 mm hole, and two hexnuts lock the rod to the center of the bearing)- a metal clamp is used in the image below. The stepper is recessed a little, to keep the original height of the threaded rod, and mounted with an aluminium angle - the mechanical alignment here is not terribly critical. The slider has 2 nuts epoxied near the ends, for stability. The little white circle is a piece of Teflon with a slit, and holds a wood screw by its un-threaded portion - in use it is parallel to the table top, and held down with a small spring. Note that the screw is parallel to the polar axis.

Other details about this mechanically extremely simple platform: The sector was made from a discarded coffee-table of 800 mm dia, made from high-density fiberboard. All bearings are for in-lines - fairly cheap and readily available. I mount them with a conical-head wood screw (only the head makes contact), pressing the center portion against a metal washer, small enough to leave the outer portion of the bearing free.

With so little gearing, force becomes an issue. You need a well balanced scope where the total COG of the moving parts is close to the axis of motion. As is, it is adequate for my 13.1" Dob (total weight a little over 30 lbs).

However, as an afterthought, I checked for possible unnecessary friction and found that the sector was actually rubbing against the frame - a slight reposition of the bearings took care of that. Also, I found that the simple south Teflon/laminate bearing tended to stick and release with a little jerk, so I put a ball bearing there, too. Then I checked the balance with the 'scope on the platform but with the driving pin removed - it turned out, by luck, to be just on the stable side - I can push the platform easily sideways, then it slowly returns to center. This done and re-assembled, no more stalling, and rewind is done in 30 seconds, almost as fast as I can drive the stepper motor without load at all. Thus, it seems to be a good margin. If I had found a problem here, I could have tried taking out the center pin and move the rocker box a bit north or south for better balance, then re-position the pin and, if needed, the Teflon pieces supporting the rocker box.

Note that there are two sets of 3 Teflon pieces - the outer ones support my 13.1" and the inner ones my 6" - the latter are a little lower and go free of the 13.1" box.

Nils Olof Carlin

Dec 7th, 2005 - 2 new images: Instead of the "classic" fork driving a peg on the sector, here is my new modification. The slider is driven by two hex nuts (hidden), one near each end of the slider. the slanting piece of aluminium is fixed to the slider, but the link arm has one ball bearing at each end, matching the linear movement of the slider to the circular movement of the platform sector. This practically eliminates play. The length of the slider and the closeness of the bearings to the threaded rod ensures minimum sensitivity to mechanical flexure - if I had re-designed the whole thing, I would have moved the link arm and its bearings even closer to the threaded rod! The parts move in a plane parallel to the sector - to match the height, I have added washers between the sector and the ball bearing until all pieces were roughly parallel to the sector.