Sunday, December 30, 2012

PICduino Stepper Motor Shield

Continuing with the PICduino theme, I made a 'shield' to test some VID29 stepper motors.  These are small, inexpensive ($15 for 6), geared steppers designed for automotive instruments.  These steppers draw very little current and can be driven directly from the PIC outputs.  A single port (Port B in my case) can drive two steppers.

VID29 stepper shield
(click for larger image)
This PICduino shield has 8 LEDs (Port C), two steppers (Port D), two pots for analog-in tests, and a MAXIM MAX232CPE RS-232 driver to test some communications. 

These boards are sized to fit the Hammond Manufacturing
"Multipurpose Plastic Enclosures (1591XX "S" Series) Economical Version" enclosures ($4.95 in single unit quantities at DigiKey).  One issue with the Arduino is the cost of enclosures is about half the cost of the fully populated CPU board!

If you need a bit more board space, you could extend the board a bit to take up the full space inside the enclosure (check the enclosure datasheet for max PCB size).

I have typically been an Assembly Code hacker, and for this project I needed some more advanced math, so I tried my first C programing in 15 years.  I had some trouble getting my mind around pointers, but once that was handled, the code worked great!

This stepper has 6 phases for a complete cycle, with 3 phases making up one degree of movement (you can see where the math requirements come from).

In the short video, I have the unit move 30 phases (10 degrees) 18 times (180 degrees total). 

(NOTE: When I play back this video, the audio is out of sync, and the pointer appears to be a bit "jerky" in one-or-two places.  This is an issue with the video, the point moves beautifully smoothly).

No comments:

Post a Comment