18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Control Circuits<br />

disables the outputs if the chip begins to overheat. For high output currents, use a slide-on<br />

DIP heat sink to prevent overheating.<br />

<strong>The</strong> motor is a 4-phase, unipolar type. This type of motor has six leads that connect to two<br />

sets of coils, with two coils in each set.<br />

Surplus motors often don’t include complete documentation, but you can sort out the leads<br />

with an ohmmeter and some experimenting. Begin by looking for a lead that measures an<br />

equal resistance (typically 5 to 50 ohms) to two of the other leads. Wire this lead to +5V and<br />

pin 2 of U5. Wire the two leads that connect to this lead to pins 1 and 3 of U5 through diodes<br />

D1 and D2. Swaping the leads at pins 1 and 3 will reverse the direction of the motor. Identify<br />

and wire the remaining three leads in the same way, but using pins 6, 7, and 8 of U5.<br />

<strong>The</strong> 5V motor is powered directly by a +5V supply. This simple drive circuit is fine for many<br />

applications, especially at lower speeds. You can find examples of other drive circuits in the<br />

documentation from Airpax or other motor manufacturers.<br />

<strong>The</strong> data sheet for the ’5804B recommends adding D1-D4 to prevent problems in the logic<br />

circuits due to mutual coupling in the motor windings. Schottky diodes have a smaller<br />

forward voltage drop (0.25V) than other silicon diodes.<br />

Resistors R1-R4 and capacitor C1 set the frequency of U4’s output. To select a speed, you<br />

write a number from 1 to 15 to bits 0-3 of the output port. Each bit controls one of U3’s<br />

switches. For example, when pin 2 of U2 is high, pins 1 and 2 of U3 connect, and R1 is one<br />

of U4’s timing components. When pin 2 of U2 is low, pins 1 and 2 of U3 are open, and R1<br />

has no effect on U4. When more than one switch is closed, the parallel combination of<br />

resistors forms the timing resistance. When all switches are open, U4’s output is high and<br />

the motor stops.<br />

In addition to the frequency of the step input, motor speed depends on the step angle of your<br />

motor and the mode selected at U5. A typical motor has a step angle of 18 degrees, which<br />

means that it requires 20 steps (360/18) for one full rotation. Using the resistor values shown<br />

and a motor with an 18-degree step angle, the motor speed will vary from 1 to 15 Hz in<br />

wave-drive or 1-phase mode.<br />

For a different range of speeds, use the formula shown to select resistor and capacitor values.<br />

For speeds from 10 to 150 Hz, use 0.01 microfarad for C1, or decrease the values of R1-R4<br />

by a factor of ten. <strong>The</strong> formula assumes that in the series R1-R4, each resistor is half the<br />

value of the preceding one. If you use a different resistor scaling, you’ll have to calculate<br />

the values of the parallel combinations of resistors to find the resulting frequencies.<br />

Bits 5 and 6 of the port select the operating mode. Wave-drive mode powers one phase at a<br />

time, while two-phase drive powers two phases at once, and half-step drive alternates<br />

<strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong> 193

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!