[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
ATM steppers & microcontrollers
Hi Mel,
I'd like to get the benefit of your knowledge about stepper
characteristics and about how you do your pulse width modulation to
microstep. I'm CCing this note to the ATM list because some other ATM's
might be interested in a family of microcontroller chips which I
recently learned about. I am quite enthusiastic about the use of these
chips in scope drives and other controller applications.
QUESTION #1: Does this look reasonable to you? I'm thinking of
microstepping like this, with one and only one coil energized all of the
time,
<html><pre>
________
coil 1 | |_______________
|<- t1 ->|
_______________
coil 2 _________|
|<--- t2 ------>|
|<-- t3 = 10 millisec? ->|
</pre></html>
where t1 / (t1+t2) is the "fraction of the step" between coil 1 and coil
2, and duty cycle is (t1+t2/t3) = 1.0 = 100%
and/or like this, with one coil energized part of the time, and all
coils off part of the time:
<html><pre>
________
coil 1 | |________________________________________
|<- t1 ->|
_______________
coil 2 _________| |________________________
|<--- t2 ------>|
|<----- t3 = 10 millisec? ----------------------->|
</pre></html>
where t1 / (t1+t2) is the "fraction of the step" between coil 1 and coil
2, and duty cycle is (t1+t2)/t3 [i.e., less than 100%]
QUESTION #2: Is this how you do your pulse width modulation with low
power to the steppers during tracking?
QUESTION #3: What's the typical "periodic error" of a stepper motor?
In other words, what's the typical error (difference) between the
equilibrium shaft position and the fraction t1/(t1+t2) [plus some
integral number of full steps]?
Or, putting it another way, what's the _largest_ number of arcseconds
of scope motion that a full step can correspond to, and still get
"sufficiently accurate" tracking?
The reason for question #3 is that I'm wondering if I can get away with
_not_ gearing down a 180-step/revolution stepper before connecting to
the worm gear shaft which drives a 144-tooth gear on the RA axis, if
t1+t2 = 256 timer intervals. The reasons for prefering to _not_ gear
down are 1. mechanical simplicity, and 2. very fast slewing
capability.
IDEAS, BACKGROUND INFO, AND SPECULATIONS:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I'm planning to use PIC 16 microcontrollers (Microchip Technology, Inc.,
http://www.microchip.com ) to control steppers -- initially just to do
simple stuff like replacing the AC synchronois motor on the RA axis on
my GEM with a stepper, but later to control control both axes, drive the
focuser, display DEC & RA on 7-segment LED's, "go to" slewing, etc.,
either with each controller running stand-alone, or possibly in a
distributed intelligence setup, with bi-directional communication with a
PC (via either serial or parallel port -- your choice).
I see two advantages of using microcontrollers instead of a single PC.
1. The scope could be used perfectly well _without_ a PC. I forsee
maybe eventually developing firmware which would give me the choice of
running either with or without a PC.
2. When used _with_ a PC, almost all of the work would be done by the
microcontrollers, so the PC would only need to give infrequent
high-level commands (similar to the HPLC language used by HP digital
plotters?) and/or interrogate the microcontrollers about the current
positions, motion directions, and speeds of the steppers. This could
also free up the printer port of the PC, so it could be used by such
things as a CCD camera.
The PIC 16 microcontrollers really look quite good for control purposes
-- choice of external or 3 different flavors of internal clock
(including crystal), built-in USART, timers, lots of I/O bits, fast RISC
CPU with most instructions executing in 4 clock cycles; program branches
require 8 clock cycles. Depending on the chip, maximum clock speeds
range from 4 MHz to 20 MHz.
The chips are _cheap_, ranging in price from $3.95 to $29.95 in small
quantities (as few as one). Since almost everything you would want
(except buffers to drive loads heavier than 25 ma, plus a 5 volt
regulator, plus maybe a crystal) is already on the chips, circuit design
& construction should be quite simple and inexpensive. A reasonably
good selection of the chips is available from JDR Microdevices
http://www.jdr.com/JDR
A board to program these things plus a ZIF socket for 28- and 40-pin
chips costs about $90, comes with software including an assembler, and
plugs into the parallel port of a PC. A basic compiler is available for
an additional $90.
The most expensive one I'm considering is the 40-pin 16C65/JW chip,
which costs $24.95 in small quantities. It has 4k 14-bit words of EPROM
program memory, 32 bits of I/O, DC to 20 MHz clock, 2 8-bit timers, 1
16-bit timer, USART, 192 8-bit registers, an 8-level stack, and
significant interrupt capability. The "firmware" can be erased and
reprogrammed as many times as you like. There is no RAM in the
conventional sense, and it's apparently not necessary because of all
those general-purpose registers. This is Harvard rather then von
Neumann CPU architecture, with a separate program memory which does not
get modified during program execution.
-- Gerry