[ Back ]

Computer drive

This is the circuit I indend to build:

How does this thing work? On the lines D0--D7, the computer puts 0 or 5 volts. These lines arrive at two latch chips (the top two 74LS373's on the drawing). A latch is a kind of mini-memory: if the chip gets a signal on its E-pin, the lines Q0--Q7 are put in the same state as D0--D7. When the signal on the E-pin is turned off, the state of Q0--Q7 remains the same, even when afterwards the state of D0--D7 changes. So, the latch remembers the eight states, and when we want to change them, we just set the lines D0--D7 and give a puls on the E-input of the latch.
All we have to do now is find a way to drive the E-lines of the latches. We only have four output-pins left on the parallel port, and to keep all possibilities for later expansion open, I use a little trick to generate eight signals with only four lines. This trick is called demultiplexing; hence the name of the 74LS155 chip in the middle left of the drawing. With the lines C1--C3, we chose which output of the demultiplexer-chip will be turned on; all the other seven outputs will be turned off. Indeed, there are eight possible combinations you can make with three lines (check it out). The C0 line is used to activate the chip: when C0 is off, all eight outputs are off; when C0 is on, the output we chose by setting C1--C3 is on. With this demultiplexer, we drive the latch-chips I mentioned earlier.
The rest of the drawing contains the CCD-part, and as I haven't been able yet to get my hands on a CCD chip, I will postpone the explanations of that part till later.

For now, I only build the stepper motor part, i.e. the two latches at the D0--D7 inputs and the multiplexer. For each stepper, four signal lines emerge from this circuit; they are amplified later on with this circuit (input lines are marked with IN; you need two of these per stepper):

This circuit is inspired by Mel Bartels'. It works like this: the rest of the circuit (in our case this is the latch) drives the IN line and puts either 0 volt or 5 volts on that line. Let's have a look at both cases:
So, at the upper input, we set 0 volt, hence a current starts to flow (green arrows at the left) activating the optocoupler (indicated by the two lightning-arrows). This causes the phototransistor at the other side of the optocoupler to conduct, so a current flows from the +12V to the earth (green arrows at the right). The transistor is not driven; it does not conduct current and the +12V cannot pass through the winding of the stepper motor.
At the downmost input is 5V, so there's no current at the left of the optocoupler so the phototransistor is not conducting. The current from the +12V at the bottom (green arrows) now has no choice but to flow to the transistor; that transistor starts conducting, and in that way, current coming from the stepper winding can pass (blue arrows).
In short: put 0V on the IN line to put no current on the winding and put 5V on the IN line to send current through it.

What about those two diodes and that zener diode? Windings (coils) have the nasty habit of counteracting changes in current through them. So, if you suddenly start sending current through a coil (current rises abruptly), the coil will work against you for a short time. Inversely, when you cut off the current (current drops), the coil will generate a current to counteract the current drop. Of course, the coil cannot keep generating this current for a long time (otherwise we'd have found a very simple solution for the energy crisis :-) ), but the current generated by the coil can be very strong during a brief period of time, and even destroy the transistors.

Let's have a closer look. We've just cut off the current through the downmost winding on the figure; so the downmost transistor is turned off. The coil generates, as explained above, current to work against us. Because the transistor is off, the current has to pass the diode, and if it's powerful enough, also passes the zener diode, to end up at the coil again. The current keeps turning rounds, until it has lost enough power and isn't able any more to pass the zener diode. By the way, this stuff also works without the zener: the current then keeps turning around for a longer time until it has decayed; by adding the zener diode, the current is stopped somewhat sooner (and thus the stepper motor reacts faster to our signals).

Monday march 20th 2000: I pay a visit to Gentronics with this shopping list:
QuantityPrice (fr)Description
204010k resistor
512574LS373 latch
12574LS155 demultiplexer
11574LS04 hex inverter
175CNY74-4 optocoupler
1189Pre-made print ECS3 (bakelite, one-sided, islands per 3)
Total469
The 10k resistors will later on turn out to be unneccessary ...

Tuesday March 21st 2000: at Radio Home I buy these things:
QtyPrice(fr)Description
4201N4007 diode 1A
250Zener diode 30V 5W
1207805 5V voltage regulator
8800,1 microfarad condensator tantalum
Total170
While I'm there, I also ask about CCD types KAF 0401 (they don't distribute Kodak), TC211 and TC215 (of which they'll try to get a price of their suppliers).

Thursday March 23rd: at Gentronics I get some sockets for the chips I've bought:
QtyPrice (fr)Description
5LC20 IC socket 20pin
2LC16
1LC14

Friday March 24th: I take look at Colin Electronics (in Lovendegem, which is an hour away by bike of where I live). Unfortunately, they don't have any of MAX6160, MAX151, TC211, TC215 of KAF0401 in stock (and also here, they've never heard about Kodak chips). Their advice is to go and look at ... Radio Home. Yes indeed.
At TI's webpage, you can find a shockingly tree Belgian suppliers, so maybe ...: EBV, SEI en Spoerle. Only the last one has something on its homepage about CCD's (do a Detailed Search, and search for CCD in Part Description). Kodak and Maxim are noble unknowns for all three suppliers.
At Maxim's page, one single Belgian supplier can be found: Master Chips.

Saturday March 25th: again some stuff from Gentronics:
QtyPrice (fr)Description
412220ohm resistor
4120TIP-122 transistor
125Bar-M-R-E pin-header
Total157
The pin-header is just a row of 40 pins next to each other. The stepper motors I salvaged from old floppy drives, have a connector with 6 holes, and you can guess the rest by yourself, don't you :-0
I really ordered TIP-120 transistors, as used in Mel Bartels' circuitry, but those didn't exist any more (they told me). So the lady behind the counter looked in a very thick book with lots of numers in it and sait that TIP-122 also would be nice. Some browsing in datasheets afterwards learns us that the TIP-122 can handle a collector-emitter voltage of 100V at 5A, whereas the TIP-120 only likes 60V.

Monday evening April 3rd april: Zeus WPI (Workgroup Informatics of the university) gave me an old 386 to play with. Soon I discover that it has no harddisk. So I enbark on a quest for a Linux version that fits on a floppy. An eavening of net-searching reveals tomsrtbt, which creates a special 1,7MB floppy (the standard way of using floppy's gives you only 1,44MB) and pushes on it a more or less usably Linux. First I tried Linux On A Floppy, but I didn't manage to covince it to read floppy's.
Then I quickly wrote a simple test program and it's midnight again ... The program is inspired on the Linux I/O port programming mini-HOWTO. One thing to take care of is that in the makefile, I use the option-static. The test program is compiled on a 'regular' computer, and there, much used functions are not pasted into each program literally, but only a short reference to a centray library of functions is stored. The mini-on-a-single-floppy Linux has no (or at least not enough) of those libraries; therefore the functions have to be pasted in the program, which of course can be done using -static. You already guessed that by now, didn't you? :-)

Tuesday evening April 4rd: cleaned up the test program a little, but unfortunately enough nothing appears to come out of the parallel port!

Wednesday evening April 5th: some more modifications to the test program. More interesting, I discover why the parallel port didn't seem to do much: I forgot to solder some crucial wires on the print! It are the four wires that should send the D0/D1/D2/D3 signals that have passed the 10k resistors to the latch-chip. Therefore, the whole circuit gets no signals, including the places where I was measuring last night ... When I measure on the resistors itself, I see that the signals the test program sends out, effectively arrive.

Thursday evening April 6th: Finally I get signals out of the computer, now something else turns up of course :-) The 10k resistors seem to be a little too much. A logic 0 gives 0V before the resistors and 0.78V after them. The chips only recognize a logic 0 when the voltage is below about 0.5V. The logic 1 poses no problems: 3.56V before the resistor becomes 3.53V after (and 2V is already enough for a logic 1).

Friday April 8th: I fetch ten 1kOhm resistors at Gentronics, costing me 20fr.

Monday April 10th april: the print with the 1k resistors instead of 10k gives good result: a 0 comes through as 0.2V and a 1 as 3.55V. Unfortunately, the circuitry past the optocoupler still doesn't work. It appears I need to add a 1k resistor in the schematic of the stepper motor control.

Wednesday evening 12th april: added the resistors, and it works! Up to now, I've built half a stepper drive (which drives two of the four windings).

Thursday April 13th: I start building the other half of the stepper drive. I run out of 1k resistors, so I fetch another ten at Gentronics (20fr).

Friday april 14th: the other half is ready and running! I quickly write step.c that rotates the motor a number of steps to the left or to the right. Halfstepping also works.

Sunday October 29th: I send a fax to EBV Elektronik, SEI and Spoerle to ask some info about CCD chips.

Monday October 30th: I've already got a reply from Spoerle, alas it only says that they have nothing to offer for us. Which is a little strange since they have some TI CCDs on their homepage. Maybe the term ``CCDs for astrophotography purposes'' has been a little bit of a bad wording ...

Links

General

Guiding a Telescope

Stepper motors

Jones on stepping motors
Mel Bartels: Motorize Your Telescope Home built plotter
Stepper Motor Intro
Basic Stepper Motor Concepts
Boondog Automation: tutorials, PCB artwork, free source code

Chips

Van Ganswijk chip directory
CHIPINFO
http://209.1.238.250/arpdf/1665.pdf

Parallel port

The PC's Parallel Port (lots of links)
Linux I/O port programming mini-HOWTO
Linux On A Floppy
tomsrtbt (Tom's floppy which has a root filesystem and is also bootable.") FTP download
Problems with printer port adapters

Copyright © 2000, Geert Vernaeve.
[ Back ]