The Circuit

 

Mel’s system uses stepper motors, which are a funny kind of DC motor.  Inside the stepper motor are 4 electro-magnetic coils.  If you turn the 4 electro-magnets on in the right order, the motor turns.  Get the order wrong and you have a vibrator instead J  To control the stepper motors, Mel choose to use 8 pins of the parallel port found on just about every computer ever made.  Why 8 pins?  Our scope needs to move Up/Down and Left/Right which takes 2 motors, since each motor has 4 electro-magnets to control, you need 8 separate signals, one for each coil.

 

Unfortunately, we can’t just connect the stepper motors directly to the parallel port (aka printer port).  If we did, the parallel port would go Poof, and we would end up with something else to work on instead of our telescope J  What we need is a Driver circuit.  That driver circuit takes the signals from the parallel port and amplifies them, which in turn runs the stepper motors.  So basically we need a circuit that has 8 low voltage inputs and 8 high voltage outputs.  Fortunately, for those that don’t really want to play with electricity, Mel sells the driver circuit in various stages from “here are the parts, go put it together” to “Here it is all done, and fully tested”  For more info see Mel’s site at http://www.efn.org/~mbartels/

 

Since I’m a Die hard “Do it yourselfer” I had to build mine from scratch, not only that I have this strange way of always having to do it just a little bit different J  So here’s what I built:

 

(My stepper control circuit, including the LED eye candy)

 

Yea, it’s a little rough around the edges, but it works.  Once I get it in a plexi-glass case, and clean the wiring up I’ll be rather proud of it!

 

Here’s A picture of the Completed electronic case, made from 1/8” Plexiglass folded with a Heat gun and some clamps J

 

 

 

** WARNING **  Techno Mumbo Jumbo Starts Now!

 

The board uses a High Speed Cmos Octal Buffer/Line Driver (Click for white sheet) to receive the input from the computer.   The neatest part about this device is all the input pins are on one side, and the output pins are on the other!  This makes wiring the board so much easier.  From the output of the line driver we go thru a 220 ohm resistor and into the gate of the IRF540 Mosfet (Click for white sheet)  Which when turned on grounds out one side of the stepper motor coil, while the other side of the coil is connected to 12VDC source (in my case an old computer power supply, which is a little overkill for this application, but it was handy!)

 

Here’s a schematic I made AFTER I completed the project. (Yea, I do things a little different J )

 

(Click for a larger picture)

 

The Software I used to create the schematic didn’t include the Octal Line Driver, so I used two inverters instead and framed them in an orange square.  The red lines indicate the output signals to the stepper coils, and the Blue lines are the Over-Voltage – Spike suppression circuit.  The only thing that caused me surprise was the Zener diode on the Over-voltage circuit.  When I first built the driver board, I didn’t include the 100k ohm resistor between the Zener diode and the Source of the Mosfet.  When I was initially playing around with the circuit, I noticed the Mosfet on the Over-voltage circuit was getting pretty dang hot, while all the other’s were rather cool.  After looking around with the O-scope I noticed that the largest spike I was getting was only 14V, it should have been up around 54 volt or so.  What really clued me in  was when I put the O-Scope probe on the gate of the Mosfet, the steppers changed tune.  Even more curious was that when I removed the lead, the steppers didn’t change back.  When I probed the Over-voltage line, the spikes were now up to 54V like I had expected and the Mosfet cooled off right away.  When I power down the board, and power it back on, the Over-voltage line went back to 14V, and again as soon as I probed the gate of the Mosfet, the steppers changed tune, and the over-voltage line jumped back to 54V,  Very strange I thought J  The only thing I could think was that the 10Meg ohm resistance of the O-scope probe, was enough to get some current flowing thru the zener, so I added the 100meg ohm resistor from the zener to source of the Mosfet, and things have been fine ever since.

 

For those of you that have no clue what I just said, it goes something like this.  When the Electro-magnet of the stepper coil is turned on, we get a pretty hefty current flow.  When we turn off the coil, the current flow doesn’t want to come to an abrupt halt, kind of like a freight train.  If we ignore this problem, what happens is we get a voltage spike, and a big one (100 – 200V or more)  This voltage easily exceeds the maximum voltage rated for our electronics, and if we ignored it our electronics would go “poof” and cease to function.

 

There are two alternatives to ignoring the over-voltage.

 

#1 We can put a simple diode across the coil.  This will dump the power back into the coil.  The down side is this causes the coil to stay on longer than we asked, which causes problems when were trying to run the motor at high speeds.

 

#2 We can allow the voltage to go fairly high, but keep it below the level that will likely cause damage.  This is the route I took after trying option #1 the first time around on the very early prototype…  To make this option work, we need to create a system that when the voltage exceeds a threshold, the system kicks in and clamps it down.  That is the reason for the 42v zener diode in the schematic.  When the voltage on the output lines exceeds the 12 volt line by 42 volts, the Mosfet kicks in and clamps the system down.  When Measuring from earth ground, we should see spike no greater than 54Volt.

 

If your wondering where I came up with a 42v zener.  Well its actually 3 zener diodes in series, 2 15 volts, and a 12 volt.  Its what Radio Shack had on hand at the time. 

 

Enough Talking, How about some more Pics?  Here’s some close up details of how I put the board together

 

  1. Mosfet Gate, signal comes from line driver
  2. Mosfet Drain, too Stepper and Over-voltage circuit
  3. Mosfet Source, to Ground
  4. Power diode, used to separate stepper output from Over-voltage circuit
  5. current limiting resistor from Line driver to Mosfet Gate (probably don’t need these, see why later)

 

(A Little wider view)

 Item 1 is the pull down resistors to keep the line driver from turning on when not attached to computer, which it surprisingly did without them!

 

 

(The system in operation)

The system is Micro-step tracking with the following settings:

PWM = 24  MsDlyX = 7  MsPaus = 466

As you can tell, I need to play around with the MsParams to get the current down,  Bet still it’s a fairly good test, I’m running 400+ mA thru the circuit and the temp of the Mosfets is just under 100F.  I’m happy with that.

 

O-scope detail during micro-stepping, you can just barely see the 54v spikes J

 

Micro-step walk thru

#1 Mosfet is off, Coil is off, voltage is at 12VDC

#2 Mosfet turns on and brings voltage to near 0 volts, stepper coil is now on (I like that nice clean transition!)

#3 Current is flowing thru stepper motor, magnetic field at full charge

#4 Mosfet Turns off

#5 See that nice spike!  Straight to 54V (42V zener on 12VDC buss = 54V J )

#6 This one Confuses me a little, I thought I would see a nice slope from 54V to 12V, instead I see more of a square wave, with a sloped top.  Maybe its feedback from the other end of the coil which is probably on now… Don’t know…

#6 Coil voltage back to 12 Vdc, ready to do it again…

 

Math Mumbo Jumbo

(or why I may not need that resistor between the line driver and the Mosfet Gate)

 

Here are some measurements, and resulting calculations I made while the circuit was disconnected from the computer, and 5VDC was applied to the input pin of the line driver.  This simulates a full load condition, and is probably a little hard on things J

 

Output of Line driver is 5 Volts

Voltage drop across the 220 ohm resistor is 0.5V

This means that only 2.3mA of current is flowing from the line driver thru to the Mosfet (.5/220=.00227)

Since this leave the Mosfet dropping 4.5 volts, and we know the current is 2.3Ma, we calculate the equivalent resistance of the Mosfet gate to source as equal to 1.98K ohm.  (4.5/.0023=1980)

 

Unfortunately, the first time I did this calculation I forgot 1 detail.  I have a LED and a resistor in parallel across the Gate-source of the Mosfet.  The resistor is a 1K ohm resistor, and I wouldn’t be surprised if the LED has an ER of 980 ohms. This accounts for all of our remaining resistance, leaving the Mosfet equivalent resistance being near infinity.  Which reminded me of what an instructor once told me “Fets or Voltage controlled devices!  That’s why their Called FIELD EFFECT TRANSITORS!”  Well, this sure would explain why the zener diodes didn’t work without the resistor in place!  It all makes so much sense now J

 

Well that was an entirely wasted effort; lets just say we have a 4.5VDC signal to the Gate of our Mosfet!

 

With this in mind let’s move onto the Output side of the Mosfet.

 

The Voltage drop measured from Drain to source was 2 Volts Dc.

This means we are dropping 10 volts across the coil of the stepper. 

The coil of the stepper measured out to 7 ohms. 

From this we can deduce that the current flow is 1.42 amps!  Which the amp meter agreed with!  So far so good. 

So if we have 1.42 amps of current and 2Vdc across our Mosfet, then the equivalent resistance of the Mosfet must be 1.4 Ohms, which pretty much agrees with the Mosfet’s white paper J

 

Now this has got me wondering if it might be possible to control the current thru the stepper motor, but varying the 5VDC line into the line driver… Hmmm have think about that one for a bit …..

 

Guess that’s it for now, Tomorrow we mount the gear sets and the stepper motors to the Scope, and see how well the hole thing works!

 

James