27220 Parallax Inc, 27220 Datasheet - Page 164

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
Page 154 · StampWorks
The step sequences for the motor are stored in DATA statements. The Step_Fwd
subroutine will read the next sequence from the table to be applied to the coils. The
StepRev subroutine is identical except that it will read the previous step. Note the
trick with the modulus (//) operator used in StepRev. By adding the maximum
value of the sequence to the current value and then applying the modulus operator,
the sequence goes in reverse. As a review, here’s the modulus math for full steps
(four steps per cycle):
0 + 3 // 4 = 3
3 + 3 // 4 = 2
2 + 3 // 4 = 1
1 + 3 // 4 = 0
This experiment reads both sides of the 10K potentiometer to determine its relative
position. The differential value between the two readings is kept positive by using
the ABS function. The position is used to determine the rotational direction and the
strength of the position is used to determine the rotational speed. Remember, the
shorter the delay between steps, the faster the stepper will rotate. A dead-band
check is used to cause the motor to stop rotating when the RCTIME readings are
nearly equal.
Taking It Further
Surplus stepper motors are very easy to come by, and the experimenter is often
faced with two challenges: 1) How to control a bipolar (4-wire) stepper motor and,
2) How to determine the coil sequence of an unknown motor.
By using the L293D the first challenge is nullified; the L293D is a push-pull driver
(versus the ULN2x03 that only sinks current) and will work – without any
modifications to the code – with unipolar and bipolar stepper motors.
The second challenge can be overcome with a multimeter. Create a table with the
wire colors as column and row headings, jotting down the resistance measured
between the wires. For example:

Related parts for 27220