Building A Stripboard Stepper Controller
HOWTO: Building A Stripboard Stepper Controller (for a Unipolar Motor)
(Note: item pictured is an older version)
The Stepper controller is responsible for a single unipolar stepper motor. There are four such modules (three if the extruder is controlled by a DC motor) in a RepRap or RepStrap. See RepStrap for an overview of all the components. (For a bipolar motor, see StripboardBipolarStepperController).
Tools and consumables
- A soldering iron and accessories (see Electronics Fabrication Guide).
- Electric drill or at least a suitable drill bit
- Some wire for jumpers/links
- Wire strippers
- Small pliers or tweezers
- An 18 pin IC socket
- U1: PIC16F628 microcontroller
- U2: ULN2803 darlington driver
- R1, R4: 4.7kΩ resistor
- R2, R3: 1kΩ resistor
- Z1: 15V zener diode
- Connectors. A simple low cost choice is to use header pins and matching sockets. Try to get keyed pins and sockets that prevent you from putting the connector on backwards, because if you do it will most probably destroy the module and possibly other connected modules. Take great care! Alternatively, you can directly solder wires into the board after putting the modules on the machine in which case you don't need any connectors. If you use connectors, you need:
- J1, J2: four pin connector (for comms)
- J3, J4: three pin connector (for opto interrupters)
- J5: six pin connector (for stepper motor)
- J6: two pin connector (for sync bus)
- A piece of stripboard with 2.54mm (0.1") spaced continuous track. It should be a minimum of 23 holes along the track direction and 15 holes sideways. It is a good idea to provide some extra space to make screw holes for mounting. For the stepper leave some extra space on the right side (as shown) because it will be useful if you change motor configurations.
Note: You will build three of these circuits, one for each motor.
This is the schematic diagram of the circuit you will be building. See reading a schematic to understand the various parts.
Preparing the board
The strips on the back of the board need to be "separated" at certain points. The easiest way to do this is to use a small electric drill with a drill bit around 3-4mm in diameter. Don't drill all the way, just far enough to cut the copper tracks. See the Electronics Fabrication Guide for more details.
This image shows the rear of the stripboard so you can see the points that were separated.
[PICTURE TEMPORARILY REMOVED FOR UPDATES]
The points marked in black are where you should separate the tracks.
Note: This is the minimum size. It is recommended that you leave sufficient additional space on all sides to allow for easy mounting. Around 20mm will be ample.
Important: There are some voltages that can and will damage components if you aren't careful. Double and triple check that:
- You have completely separated the necessary tracks. Use a multimeter or continuity checker if you have one.
- You have not connected any two adjacent tracks with shards of copper. It is a good idea to scrape down the channels to ensure there are no fragments. Again, check this with a multimeter or continuity checker.
Making the board
Solder the components into the board as pictured below. See the Electronics Fabrication Guide if you're new to soldering or component placement.
Make sure you use the 18 pin IC socket for the PIC16F628, because you will probably want to remove this chip at some stage to re-program it.
Pay particular attention to:
- U1, U2 chip orientation. The notch should be at the top as pictured.
The 12V line must carry quite high current, so you should use fairly heavy duty wire for the 12V connections wherever possible.
The connector pins are numbered from the top of the board down, when looking at it as pictured.
- J1 Comms in
- Comms (from Comms board)
- J2 Comms out
- Comms (to Y axis)
- J3 Maximum detector
- Photo transistor
- J4 Minimum detector
- Photo transistor
- J5 Stepper motor
- Coil A1
- Coil B1
- Coil A2
- Coil B2
- Not connected
- J6: Sync bus
- 1st dimension sync (to Y and Z modules)
- 2nd dimension sync (to Y and Z modules)
The Z axis is identical to the X axis.
The Y axis does not require R1 and R4.
A ULN2003 can be used, but the device has a couple less pins and can provide less current. Insert it in the socket starting at pin 2, and only use it for driving small stepper motors.
An alternative, Stepper Driver With UDN2559 design which can provide more current.
See the Stepper Motor Controller page for a copy of the firmware and a more detailed description of the API used to control it.
The network addresses for these are:
- X-Axis: 2
- Y-Axis: 3
- Z-Axis: 4
A snapshot of the latest source is available for viewing
If you experience trouble, please share the problems (and resolutions) with us.
When testing without sensors fitted, short out connections 1&2 on J3 and J4 with 200-300 ohm resistors. If your device still doesn't work, consider that you may have miswired J3, J4, or R2/R3.
Laying the long jumper wire A6-K7 inbetween R1 & R4 will prevent R4 being pushed into R1.
Testing The Unit
Testing is accomplished with the "poke" command from the SNAP firmware/tools directory. First, test your communications link as per the serial controller board section.I used device /dev/ttyUSB0 - a serial USB adaptor. The -v option gives debugging, which tells you if the device is sending an ACK back or not.
Send the "forward" command:
This sets it into forward motion at speed 50 (1-255 will also work)
To stop the motor, use
This will stop the motor (speed 0) and hold position.
To power down the motor, use
- Building A Stripboard Comms Controller
- Stepper Motor Controller for details on the API and options to the "poke" utility.
-- Main.SimonMcAuliffe - 02 Feb 2006