15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FIGURE 23.4 A hardware interface of a bipolar stepper motor and the linked-list data structure used by the software<br />

to spin the motor.<br />

passing current through four coils, exactly two at a time. There are five or six wires on a unipolar stepper<br />

motor. For both types of stepper motors, the software outputs the sequence 1010, 1001, 0101, 0110 to<br />

spin the motor. The software makes one change (e.g., change from 1001 to 0101) to affect one step. The software<br />

repeats the entire sequence over and over at regular time intervals between changes to make the motor<br />

spin at a constant rate. Some stepper motors will move on half-steps by outputting the sequence 1010,<br />

1000, 1001, 0001, 0101, 0100, 0110, 0010. Assuming the motor torque is large enough to overcome the<br />

mechanical resistance (load on the shaft), each output change causes the motor to step a predefined angle.<br />

One of the key parameters that determine whether the motor will slip (a computer change without the<br />

shaft moving) is the jerk, which is the derivative of the acceleration (i.e., third derivative of the shaft<br />

position). Software algorithms that minimize jerk are less likely to cause a motor slip. If the computer<br />

outputs the sequence in the opposite order, the motor spins in the other direction. A circular linked list<br />

data structure, as shown in Fig. 23.4, is a convenient software implementation that guarantees the proper<br />

motor sequence is maintained.<br />

23.5 Data Acquisition Systems<br />

Before designing a data acquisition system (DAS) the system goals must be clearly understood. The system<br />

can be classified as a quantitative DAS, if the specifications can be defined explicitly in terms of desired<br />

range, resolution, precision, and frequencies of interest. If the specifications are more loosely defined,<br />

we classify it as a qualitative DAS. Examples of qualitative DASs include systems that mimic the human<br />

senses where the specifications are defined using terms like “sounds good,” “looks pretty,” and “feels right.”<br />

Other qualitative DASs involve the detection of events. In these types of systems, the specifications are<br />

expressed in terms of specificity and sensitivity. For example, some premature infants stop breathing<br />

during sleep. If we can detect this event and “wake up the baby,” it will start breathing again. An apnea<br />

monitor is attached to the baby as it sleeps to alert the parents to this life-threatening event. Other binary<br />

detection systems include the presence/absence of a burglar or the presence/absence of cancer. A true<br />

positive (TP) is defined when the condition exists (the baby stops breathing) and the system properly<br />

detects it (the alarm rings). A false positive (FP) is defined when the condition does not exist (the baby<br />

is breathing normally) but the system thinks it exists (the alarm rings). A false negative (FN) occurs when<br />

the condition exists (the baby stops breathing) but the system does not think it exists (the alarm is silent,<br />

and baby dies). Sensitivity, TP/(TP + FN), is the fraction of properly detected events (the baby stops<br />

breathing and the alarm rings) over the total number of events (the baby stops breathing). It is a measure<br />

of how well our system can detect an event. A sensitivity of 1 means the baby will not die. Specificity,<br />

TP/(TP + FP), is the fraction of properly detected events (the baby stops breathing and the alarm rings)<br />

over the total number of detections (number of alarms). It is a measure of how much we believe the<br />

system is correct when it says it has detected an event. A specificity of 1 means when the alarm rings,<br />

the parents will rush to the baby’s crib and resuscitate the baby.<br />

© 2002 by CRC Press LLC<br />

+12<br />

µC stepper motor<br />

PB3<br />

PB2<br />

PB1<br />

PB0<br />

L293<br />

B<br />

A<br />

data<br />

next<br />

periodic interrupt<br />

PORTB=pt->data;<br />

pt = pt->next;<br />

return from interrupt<br />

pt<br />

1010 1001 0101 0110

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

Saved successfully!

Ooh no, something went wrong!