Silicon ChipUniversal Stepper Motor Controller - June 1998 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Saving greenhouse gases
  4. Feature: Troubleshooting Your PC; Pt.2 by Bob Dyball
  5. Feature: Vantis Synario Starter Software by Rick Walters
  6. Project: Universal High-Energy Ignition System by John Clarke
  7. Serviceman's Log: Variety: the spice of life? by The TV Serviceman
  8. Order Form
  9. Book Store
  10. Feature: Understanding Electric Lighting; Pt.7 by Julian Edgar
  11. Feature: Radio Control by Bob Young
  12. Feature: Computer Bits by Jason Cole
  13. Project: The Roadies' Friend Cable Tester by Paul Hoad
  14. Vintage Radio: Look Ma, no tuning gang! by John Hill
  15. Project: Universal Stepper Motor Controller by Rick Walters
  16. Project: Command Control For Model Railways; Pt.5 by Barry Grieger
  17. Subscriptions
  18. Back Issues
  19. Market Centre
  20. Advertising Index
  21. Outer Back Cover

This is only a preview of the June 1998 issue of Silicon Chip.

You can view 32 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Troubleshooting Your PC; Pt.1 (May 1998)
  • Troubleshooting Your PC; Pt.2 (June 1998)
  • Troubleshooting Your PC; Pt.3 (July 1998)
  • Troubleshooting Your PC; Pt.4 (August 1998)
  • Troubleshooting Your PC; Pt.5 (September 1998)
Items relevant to "Universal High-Energy Ignition System":
  • Universal High-Energy Ignition System PCB pattern (PDF download) [05305981] (Free)
Articles in this series:
  • Universal High-Energy Ignition System (June 1998)
  • Programmable Ignition Timing Module For Cars (June 1999)
  • Programmable Ignition Timing Module For Cars; Pt.2 (July 1999)
Articles in this series:
  • Understanding Electric Lighting; Pt.1 (November 1997)
  • Understanding Electric Lighting; Pt.2 (December 1997)
  • Understanding Electric Lighting; Pt.3 (January 1998)
  • Understanding Electric Lighting; Pt.4 (February 1998)
  • Understanding Electric Lighting; Pt.5 (March 1998)
  • Understanding Electric Lighting; Pt.6 (April 1998)
  • Understanding Electric Lighting; Pt.7 (June 1998)
  • Understanding Electric Lighting; Pt.8 (July 1998)
  • Electric Lighting; Pt.9 (November 1998)
  • Electric Lighting; Pt.10 (January 1999)
  • Electric Lighting; Pt.11 (February 1999)
  • Electric Lighting; Pt.12 (March 1999)
  • Electric Lighting; Pt.13 (April 1999)
  • Electric Lighting, Pt.14 (August 1999)
  • Electric Lighting; Pt.15 (November 1999)
  • Electric Lighting; Pt.16 (December 1999)
Articles in this series:
  • Radio Control (May 1998)
  • Radio Control (June 1998)
  • Radio Control (July 1998)
  • Radio-controlled gliders; pt.3 (August 1998)
Articles in this series:
  • Computer Bits (July 1989)
  • Computer Bits (August 1989)
  • Computer Bits (September 1989)
  • Computer Bits (October 1989)
  • Computer Bits (November 1989)
  • Computer Bits (January 1990)
  • Computer Bits (April 1990)
  • Computer Bits (October 1990)
  • Computer Bits (November 1990)
  • Computer Bits (December 1990)
  • Computer Bits (January 1991)
  • Computer Bits (February 1991)
  • Computer Bits (March 1991)
  • Computer Bits (April 1991)
  • Computer Bits (May 1991)
  • Computer Bits (June 1991)
  • Computer Bits (July 1991)
  • Computer Bits (August 1991)
  • Computer Bits (September 1991)
  • Computer Bits (October 1991)
  • Computer Bits (November 1991)
  • Computer Bits (December 1991)
  • Computer Bits (January 1992)
  • Computer Bits (February 1992)
  • Computer Bits (March 1992)
  • Computer Bits (May 1992)
  • Computer Bits (June 1992)
  • Computer Bits (July 1992)
  • Computer Bits (September 1992)
  • Computer Bits (October 1992)
  • Computer Bits (November 1992)
  • Computer Bits (December 1992)
  • Computer Bits (February 1993)
  • Computer Bits (April 1993)
  • Computer Bits (May 1993)
  • Computer Bits (June 1993)
  • Computer Bits (October 1993)
  • Computer Bits (March 1994)
  • Computer Bits (May 1994)
  • Computer Bits (June 1994)
  • Computer Bits (July 1994)
  • Computer Bits (October 1994)
  • Computer Bits (November 1994)
  • Computer Bits (December 1994)
  • Computer Bits (January 1995)
  • Computer Bits (February 1995)
  • Computer Bits (March 1995)
  • Computer Bits (April 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • Computer Bits (July 1995)
  • Computer Bits (September 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits (December 1995)
  • Computer Bits (January 1996)
  • Computer Bits (February 1996)
  • Computer Bits (March 1996)
  • Computer Bits (May 1996)
  • Computer Bits (June 1996)
  • Computer Bits (July 1996)
  • Computer Bits (August 1996)
  • Computer Bits (January 1997)
  • Computer Bits (April 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Computer Bits (July 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits (September 1997)
  • Computer Bits (October 1997)
  • Computer Bits (November 1997)
  • Computer Bits (April 1998)
  • Computer Bits (June 1998)
  • Computer Bits (July 1998)
  • Computer Bits (November 1998)
  • Computer Bits (December 1998)
  • Control Your World Using Linux (July 2011)
Items relevant to "Universal Stepper Motor Controller":
  • Universal Stepper Motor Controller PCB pattern (PDF download) [10106981] (Free)
  • Universal Stepper Motor Controller panel artwork (PDF download) (Free)
Items relevant to "Command Control For Model Railways; Pt.5":
  • Model Railway Receiver/Decoder Module PCB patterns (PDF download) [09105981/2] (Free)
  • Model Railway Command Control PCB patterns (PDF download) [09102981/09103981] (Free)
Articles in this series:
  • Computer Bits (December 1989)
  • Command Control For Model Railways; Pt.1 (January 1998)
  • Command Control For Model Railways; Pt.2 (February 1998)
  • Command Control For Model Railways; Pt.3 (March 1998)
  • Command Control For Model Railways; Pt.4 (May 1998)
  • Command Control For Model Railways; Pt.5 (June 1998)

Purchase a printed copy of this issue for $10.00.

Universal Stepper Motor Controller This circuit can be used to drive a stepper motor for a preset number of revolutions in the forward or reverse direction at a speed which can be varied. Jumpers on the board allow it to drive steppers with 1.8 or 7.5 degree increments. By RICK WALTERS This circuit is a “grown-up” version of the manual stepper motor driver that we featured in the June 1997 issue of SILICON CHIP. It was very popular but a number of readers asked us how it could be modified to drive larger stepper motors. And they want­ ed 74  Silicon Chip several other features as well. As it turned out, modifying the original circuit was not that straightforward and we decided that rather than “bodgie up” the previous design, we should produce a new version with all the bells and whistles that our readers have been asking for. This new stepper motor driver has a RUN/STOP switch, a FORWARD/ REVERSE switch and a speed control. These functions are similar to those on the previous board but with the addition of four more ICs, a couple of transistors, a few small components and two thumbwheel switches it becomes a motor driver which can be programmed to step a motor for 1-99 revolutions. Jumpers on the board allow you to use steppers with 1.8 degree or 7.5 degree increments. One immediate use which springs to mind for this option is as a coil winder. We looked at adding a third thumbwheel and the associated com- ponents but it would add a fair bit more to the cost and rarely would you ever need to wind 999 turns. How it works? Fig.1 shows the new circuit. The core of the circuit, in­volving IC1a, IC2 & IC3, is similar to that in the June 1997 issue. However, to make the circuit programmable via decade switch­es, we have added four 4510 pre­settable up-down counters. Since many readers may not have seen the previous circuit, we will give a complete circuit description. As before, the circuit can be divided into three sections: one controlling the duration of operation, one controlling the speed and direction of stepping and the third controlling the stepper motor drivers. Let’s look first at the speed section, involving IC1a, a NAND Schmitt trigger configured as a clock pulse generator. With switch S1 in the STOP position, the output of IC1a is held high and there are no clock pulses into IC2, a 4017 decade counter. When S1 is moved to RUN, IC1a is enabled and it will begin to oscillate. Its output will be a square wave, the fre­quency of which is dependent on the value of the capacitor from its input, pin 2, to ground (0V) and the value of the resistance between its output, pin 3, and input, pin 2. By including a 250kΩ potentiometer in this path we can vary the frequency over a wide range. IC1a’s square wave output clocks IC2 and causes each of its outputs (pins 3,2,4,7,10,1) to go high (+5V) in sequence. The output pulses from pins 2 & 7 are fed via diodes D5 and D7 (wired as an AND gate) and inverter IC1b to clock flipflop IC3a, while the outputs from pins 4 and 10 are fed via diodes D6 & D8 (anoth­er AND gate) and through IC1c to clock flipflop IC3b. When IC2’s pin 1 goes high, it resets IC2 via diode D1, after a slight delay introduced by the 10kΩ resistor and .001µF capacitor. Thus one complete cycle of IC2 is actually four motor steps. Parts List 1 PC board, code 10106981, 112mm x 98mm 1 plastic instrument case, Jaycar HB-5910 or equivalent 1 power transformer, Jaycar MM-2002 or equivalent 1 amp (T1) or 1 power transformer, Jaycar MM-2004 or equivalent 2 amp (T1) 2 SPDT toggle switches (S1,S3) 1 SPDT toggle switch (S7, optional) 1 DPDT toggle switch (S2) 2 BCD thumbwheel switches, Altronics S-3300 or equivalent (S4,S5) 1 pair of end plates for above, Altronics S-3305 or equivalent 1 250VAC mains switch (with indicator), Jaycar SK-0985 or equiv­alent (S6) 1 IEC mains input socket (with fuseholder), Jaycar PP-4004 or equivalent 1 0.25A slow-blow 5mm x 20mm fuse 1 IEC mains lead, Jaycar PS4106 or equivalent 1 6-pin connector, Jaycar PP2024 or equivalent Semiconductors 1 4093 quad NAND Schmitt trigger (IC1) 1 4017 decade counter (IC2) 1 4027 dual JK flipflop (IC3) 4 4510 presettable up-down counters (IC4-IC7) 1 78L05 voltage regulator (REG1) 6 BC548 NPN transistors (Q1,Q6,Q7,Q12-Q14) 4 BD680 or BD682 PNP Darlington power transistors (Q2,Q4,Q8,Q10) 4 BD679 or BD681 NPN Darlington power transistors (Q3,Q5,Q9,Q11) 8 1N914 small signal diodes (D1-D8) 1 1N4004 1A power diode (D9) 1 1N4004 1A power diode (D10) or 1 1N5404 3A power diode (D10) 1 BR610 100V 6A bridge rectifier (BR1) Capacitors 1 4700µF 25VW PC electrolytic 1 470µF 25VW PC electrolytic 1 100µF 16VW PC electrolytic 1 10µF 25VW PC electrolytic 1 0.22µF MKT polyester 3 0.1µF monolithic ceramic (MC) 2 0.1µF MKT polyester 1 .01µF MKT polyester 2 .001µF MKT polyester Resistors (0.25W, 1%) 3 100kΩ 15 10kΩ 7 47kΩ 8 4.7kΩ Miscellaneous 1 knob for speed control 1 1.6mm baseplate, 220mm x 150mm 4 6PK x 6mm self-tapping screws 13 PC stakes 1 4mm x 15mm screw 2 4mm x 6mm screws 5 4mm nuts 4 4mm flat washers 4 4mm toothed washers 3 earth lugs 4 3mm x 10mm threaded spacers 11 3mm x 6mm screws 1 3mm x 12mm screw 3 3mm flat washers 3 3mm star washers 4 3mm nuts 100mm rainbow cable red & black hookup wire tinned copper wire Note. While the Jaycar MM2004 power transformer is shown in their catalog as having identical output voltages to the MM2002, the one we were supplied with only had 6V, 9V, 12V and 15V taps. These voltage taps are probably satisfac­ tory for this project. Bridge drivers Before we describe the logic operations any further, let’s have a look at the stepper drivers. The type of stepper motor specified has two windings, designated here as MA and MB. Each winding is connected across a bridge of four transistors (ie, like a bridge rectifier in re­verse) comprising Q2, Q3, Q4 & Q5 and Q8, Q9, Q10 & Q11. We will first describe how winding MA is driven; the drive to MB is identical. Assume pin 1 of IC3a is high and therefore its complement, pin 2, will June 1998  75 76  Silicon Chip Fig.1 (facing page): the heart of the circuit is formed by oscillator IC1a, decade counter IC2 and dual JK flipflop IC3 and these control the direction and speed of the stepper motor. Counters IC4, IC5, IC6 and IC7 control the number of steps. be low. Pin 1 will turn Q1 & Q5 on, and Q2 will be turned on, as well. Q6, Q3 & Q4 will be turned off. Therefore current will flow through motor winding MA via Q2 & Q5. When IC3a is toggled, pin 1 will go low and pin 2 will go high. This will turn off those transistors which were on and turn Q3, Q4 and Q6 on. Current will now flow through MA in the other direction, via Q4 & Q3. A similar sequence occurs with flipflop IC3b and the motor winding MB. This sequence of voltage and current reversals causes the motor to step. The reversing switch, S2, is wired to the MB wind­ing and reverses the direction of the current relative to MA, causing the motor to change its direction of rotation. The resistor and capacitor from pins 4 & 12 of IC3 reset these flipflops at power-up, ensuring the motor will always rotate in a known direction. To recap so far, the motor is started by S1, the speed is varied by VR1 and the direction (selected while the motor is stopped) is set by S2. Revolution counter To count the number of revolutions of the motor we first need to know whether we are driving a 1.8 or 7.5 degrees per step unit. A 7.5 degree motor takes 48 steps per revolution while a 1.8 degree unit has to make 200 steps. The steps are counted by IC4 and IC5 which are arranged as presettable dividers. Each time IC2 completes one cycle and resets itself via its pin 1 output (as previously described) this pulse also clocks the dividers. But we are getting slightly ahead of ourselves. When S1 is moved to RUN, the low to high voltage transition on its common pin is coupled through the .01µF capacitor to the preset enable inputs (pin 1) of IC6 & IC7 and via diode D4 to IC4 & IC5. This loads the BCD value which is present at the “P” inputs into each counter. IC4 has P1 (bit 1) tied high and a jumper to pull P3 (bit 4) high. This Fig.2: this is the component layout for the PC board. It also shows the wiring for the optional switch (S7) to take the place of jumpers J1 & J2. This will allow easy switching between 1.8 and 7.5 degree steppers. will give a division of 10 or 50. Similarly, IC5 is able to divide by 0 or 2. By using the appropriate link we can divide by 12 (10+2) or 50 (50+0). This, together with the four steps provided by IC2, makes up one complete revolution for each type of motor. So each time counters IC4 and IC5 count down to zero, pin 7 of IC4, which is normally high, will go low, momentarily turning Q13 off. This transistor is normally held on by the 47kΩ resistor at its base. The positive-going pulse at its collector reloads the preset count into IC4 and IC5 through diode D3 and also applies a clock (count down) pulse to IC6 and IC7. Thumbwheel setting Thus, IC4 and IC5 continuously count down and after each full revo- lution of the motor they are preset by transistor Q13 which also clocks IC6 and IC7. These are also presettable down counters. When S1 is moved to RUN, they are loaded with the value set on the thumbwheel switches as described earlier. After the preset number of revolutions has occurred, pin 7 of IC6 will go low, turning transistor Q14 off. This allows its collector to go high, holding IC2 reset through D2. With no drive pulses from IC2 the motor will stop. To make the controller as flexible as possible we have added a MODE switch, S3, which we have called the PRESET/CONTinu­ous switch. In the CONT position, the motor will run continuously while S1 is set to RUN. Conversely, in the PRESET position, the motor will turn for the number of revolutions set on the thumbwheels June 1998  77 Fig.3: use this diagram to complete the wiring from the PC board to the front and rear panels and to the mains transformer. and then stop. Switching to STOP then RUN will rotate the motor again for the same number of preset revolutions. Thus, by setting the thumbwheels to 75 and running the motor for three cycles, it would rotate it for 225 rev78  Silicon Chip olutions. Assembling the PC board The circuitry for the new Stepper Motor Controller is accommodated on a PC board which measures 113 x 99mm and is coded 10106981. The component layout for the board is shown in Fig.2. The first step in assembly is to inspect the board for etching faults or open circuit tracks. The tracks between IC pads should be checked with a multimeter to ensure they are not shorting to the pads. Begin by inserting and soldering the 15 links. Then contin­ue by fitting the This view inside the case shows the wiring to the PC board and to the mains transformer and front-panel. Note the rainbow cable that’s used to wire the decade switches. resistors, capacitors, diodes, transistors and ICs. Add the components a few at a time, soldering and cutting the leads as you go. Double check the direction of diodes and capacitors before you solder them in. We have specified a choice of two types for diode D10 in the parts list. If you are using a low current motor you can use a 1N4004 diode type but if the motor coils are going to draw around 1A or more then the type 1N5404 should be fitted. The power transformer we have specified will readily supply the higher current. Once the PC board assembly is complete, it’s time to drill the front and rear panels as well as the baseplate. The easiest way to cut the required rectangular holes in the plastic panels is to mark the cutout on the rear with a scriber, then using a hammer and a sharp chisel, outline them from the back. When the panel is turned over you can see the hole outline and it can be readily chiselled from the front. After mounting all the hardware you can begin the wiring, as shown in the diagram of Fig.3. You will see that there are four wires shown dotted on the PC board. These are run under the PC board to keep the heavy motor currents away from the digital circuitry. We used a short length of rainbow cable to wire the thumb­ wheels as there are nine wires and it is easy to get them mixed up if they are all the same colour. The wires from the tens switch (S4) go to IC6, while those from the units switch (S5) go to IC7. The diagram of Fig.3 shows the wiring details. Make sure you sleeve and heatshrink all the connections to the mains switch (S6), power transformer and the mains input socket. A large sleeve should also be fitted right over the IEC socket for added safety. Note that the leads to the mains switch should also be sleeved in heatshrink tubing for some distance as shown in the above photo, so that the mains wiring cannot possibly come adrift. Alternatively, you can use cable ties to securely bind the mains wiring. We also recommend that the case of the pot be earthed to the baseplate – see Fig.3. We have made the mains connections to the transformer fairly inaccessible, as they are quite difficult to sleeve adequately. We have used a power transformer with a multi-tapped sec­ ondary to cater for the wide range of stepper motors which are available. The 6.3V or 7.5V tap should be suitable for most 5V single winding motors and the 8.5V or 9.5V tap will drive 5V centre-tapped motors (where the tap is not being used), or 12V motors without tapped windings. The higher voltage taps will allow you to add a resistor in series with each winding to obtain higher torque June 1998  79 The rear panel carries the IEC mains input socket (with fuseholder) plus a 6-pin output connector for the stepper motors. without exces­ sive current flowing, or even run the somewhat rare 24V steppers. Testing It is wise to check the 240VAC mains wiring with a multi­meter before applying power. You should read zero ohms from the earth pin on the IEC socket to the metal base plate. When the mains switch is off there should be an extremely high resistance between the Active and Neutral pins but when the switch is turned on, the reading should drop to around 60-70Ω which represents the resistance of the trans- You can use this Universal Stepper Motor Controller to drive a range of stepper motors for a preset number of revolu­tions in the forward or reverse direction at a speed which can be varied 80  Silicon Chip former primary winding. A reading of around 1-2Ω is bad news. Fix the problem! If the reading stays very high you have either mixed up the switch wires or forgotten to fit the fuse. You will have to determine the voltage necessary for the motor you plan to use and connect the bridge rectifier to the appropriate tap on the power transformer. Leave the motor un­ plugged at this stage. Plug the mains lead into the IEC socket, turn on the front panel POWER switch and then plug the 3-pin mains plug into a power point. Turn the mains on, checking that the power indicator in the front panel switch lights. If not, turn the mains off immediate­ly, remove the 3-pin plug from the power point and recheck all your mains wiring. Once the indicator is working you should measure the vol­ tage at the 4700µF capacitor. It should be roughly 1.5 times the AC tap voltage you selected. Next, measure the voltage between pins 7 and 14 of IC1. This should be 5V ±5%. This voltage should also be present at pin 16 of each of the other ICs, while keeping the meter’s negative lead on pin 7 of IC1. The phasing for 1.8 degree steppers appears to be black to pin 1 on the rear connector, red to pin 2, white to Fig.4: above is the full-size etching pattern for the PC board, while at right is the full-size front panel artwork. pin 5 and green to pin 6. This will rotate the motor to agree with the front panel switch. If your stepper has different colours, use your multimeter (switched to Ohms) to find the wire pairs and connect one pair to pins 1 & 2. Poke the other wires into pins 5 & 6 and swap them if the motor runs in the wrong direction. Once they are correct you can fit the pins and push them into the plug. Mineba stepper motors (available from Jaycar) are 7.5 de­grees per step and are wired with brown - pin 1, red - pin 2, yellow pin 5 and orange - pin 6. If you want to run different steppers at different times, you will need a wired plug for each one. Alternatively, you could wire the stepper up to a 4-way insulated terminal block (as shown in one the photos) and then wire that up to the 6-way plug. If you want to frequently change between 1.8 or 7.5 degree steppers, it may be desirable to wire up a switch to take the place of jumpers J1 & J2. We have shown the wiring for this optional switch (S7) in the PC board layout diagram of Fig.2. Fault finding If you are careful with your assembly and check thoroughly as you proceed, everything should work, but if bad luck inter­ venes, you will have do some fault-finding with your multimeter. If you turn the speed control to minimum and trace the clock pulses through the circuit an analog or digital multimeter set to read 5V will jump around if the clock pulses are present, but give a steady reading if no clock is present. Pin 3 of IC3 should continuously alternate between ground (0V) and +5V. IC2 pins 2, 4, 7 & 10 should sit at ground and swing to +5V sequentially. Pins 1, 2, 3, 13, 14 & 15 of IC3 should alternate SC between ground and +5V. June 1998  81