Build A Stripboard Bipolar Stepper Controller
Contents
HOWTO: Build A Stripboard Bipolar Stepper Controller
Introduction
The Stepper controller is responsible for a single motor. There are three such modules in a RepRap or RepStrap. See RepStrap for an overview of all the components.
Requirements
Tools and consumables
- A soldering iron and accessories (see Electronics Fabrication Guide).
- Solder
- Electric drill or at least a suitable drill bit
- Some wire for jumpers/links
- Wire strippers
- Small pliers or tweezers
Components
- R1 4.7kΩ
- R2 1kΩ
- R3 1kΩ
- R4 4.7kΩ
- R5 10kΩ
- C1 0.1μF
- C2 0.1μF
- C3 3nF
- U1 PIC16F628
- U2 SN754410 (or a stack of two SN754410s, see below)
Note: You will build three of these circuits, one for each motor.
Schematic
Preparing the board
Making the board
Board connections
Variations
J7 is for connection to slave motor boards where multiple motors need to run synchronised. It is not required if you are only driving a single motor.
For the NEMA 17 stepper motors, the wiring to J5 should be
- Green (top pin)
- Black
- Blue
- Red (bottom pin)
Firmware
See the Stepper Motor Controller page for a copy of the firmware.
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
Troubleshooting
If you experience trouble, please share the problems (and resolutions) with us.
Testing The Unit
If opto-interrupters are not available, the limiters can be bypassed for testing by shorting out pins 1 and 2 of the opto-interrupter connectors (the top two pins). If this is not done, the motors will not move.
Testing the stepping sequence
With the comms cables and opto-interrupters connected (or bypassed opto-interrupters) and the motor disconnected, use a battery powered voltmeter (multimeter on volts setting) to check the outputs of the motor connector. To do this, you will want to single step the motor forwards and check the power is cycling correctly and outputting on all pins in the right sequence.
For Linux, to single step the easiest way is to use the poke command:
For Windows, the easiest way is to use the GUI stepper exerciser. Select the X axis position slider -- it will usually have the focus when you run the application anyway. The stepper will advance a single step every time you press the right arrow key. The steps are very small, so you won't see anything visibly happen on the GUI. When using this approach, if you power off the motor module also re-start the application so both are reset together. This method also works on Linux of course.
The stepper is actually configured to half-step, so each time you request a step it is really only performing half a step. As you step forward, you should notice the following sequence of outputs, cycling through in order repeatedly. The pinouts are 1 to 4 as seen from the top-down on the stripboard. Where you see 1->2 this means the voltage measured from pin 1 (negative probe on the voltmeter) to pin 2 (positive probe on the voltmeter). Where you see +ve, that indicates you should measure a positive voltage. It will be the same as your 12V supply voltage but it is oscillating rapidly so depending on your multimeter, it may measure slightly lower. Where you see -ve, that indicates you should measure a negative voltage. This will be the negative of your 12V supply voltage value. Where you see 0, that indicates you should measure no voltage.
Don't worry too much which step you're starting in, just check that it follows the sequence:
Step 1:
- 1->2: +ve
- 3->4: 0
Step 2: This is the step you'll normally start in using the methods described above.
- 1->2: +ve
- 3->4: +ve
Step 3:
- 1->2: 0
- 3->4: +ve
Step 4:
- 1->2: -ve
- 3->4 +ve
Step 5:
- 1->2: -ve
- 3->4: 0
Step 6:
- 1->2: -ve
- 3->4: -ve
Step 7:
- 1->2: 0
- 3->4: -ve
Step 8:
- 1->2: +ve
- 3->4: -ve
Then back to step 1.
If you step in reverse, you will cycle through in the reverse order.
For Linux, to reverse step use
For Windows or Linux using the GUI, just press the left arrow key but note that once you get back to the leftmost slider position you won't be able to go any further, so step forward a bit again first or drag the slider to the right a bit to give yourself some room to move.
Testing the motor wiring
You cannot completely check the wiring order just using a multimeter because it depends on the orientation of the coils within motor. However, the following should be true:
- Use an ohmmeter (resistance setting on a multimeter) to measure the resistance of the motor coils.
- The two wires connected to pins 1 and 2 should show some conductivity. This will be lower for higher power motors. For the NEMA-17 motors, it should be only about 1 ohm.
- The two wires connected to pins 3 and 3 should show some conductivity.
- There should not be any conductivity between other combinations of wires.
See Also
- Slave board for additional motors
- RepStrap
- Building A Stripboard Stepper Controller for a unipolar motor
- Building A Stripboard Comms Controller
-- Main.SimonMcAuliffe - 11 Mar 2006