Stepper Motor Controller Card v1.2

From RepRap
Jump to: navigation, search
<div class="thumb tright">

One of these boards controls each stepper motor in the RepRap. You'll need three of these to build the Darwin design.


<div class="thumb tright">

This board is a modified Universal Controller Board v1.2. as shown on the right.

Build that first, then follow the steps here.

Make it!

<div class="thumb tright">

There is very little work needed to take a universal controller board with all the common components and to turn it into a stepper controller. All you need to do is to add the following components, which are shown fitted in the left-hand side of the second picture (hint: a 4K7 resistor is yellow-purple-red):

Component Value
P3 2 pin connector
R10 4K7 ohm resistor
R11 4K7 ohm resistor

These components form the synchronization link between the stepper control boards. Fit them first or the heatsink gets in the way.

Bolt a heatsink to the L298N (U2) as shown in the picture above. Any heatsink that will handle about 10oC per watt or better will do. Put a little thermally-conducting silicone grease between the chip tab and the heatsink before you tighten it up. Do not slather it on with a trowel: once you've filled the gap between heatsink and component there is no benefit in having an excess, and it just oozes out making a sticky mess of things.

For details of the stepper motors RepRap uses and instructions on wiring them up, follow this link.

<div class="thumb tright">

In addition, the stepper motor connector (P9, top right of the picture) has two capacitors (C5 and C6) beside it for an extruder controller. These are not needed for a stepper controller, but you should put dabs of solder over the holes where they would have connected on the reverse of the board. This is because those connections have to carry a high current, and the drilled holes increase their resistance slightly.

There are three of these boards for the X, Y, and Z stepper motors respectively. Label them X, Y, and Z with a felt-tipped pen as you build them so you don't forget which will be which.

Program It!

Now that your boards are complete, you will need to program them.

If you are not familiar with programming firmware, please see our guide on programming a PIC.

For each board, program a 16F648 or 16F648A chip with the appropriate firmware file for each axis. The following table lists which firmware to use on each board:

Firmware File Axis
stepmotor.hex X
stepmotorb.hex Y
stepmotorc.hex Z

The programs in each are identical except for one number - the address of the corresponding PIC in the token ring.

You can program the PICs without unplugging them from the board. To see how click here.

As mentioned earlier, it's very convenient to label the PICs. I find that the best way to do this is to put a dab of typewriter correction fluid on each one, then to write X, Y, or Z on that when it's dry. (Mystery: there's hardly a typewriter left on the planet; so how is it that everywhere still has typewriter correction fluid?)

Alternatively, you can buy small stickers at an office supply store, write on that, and then stick it on the chip. Regardless of the method you use, its important to label the chip so you know which board is which.

The three boards are now ready for attaching to your RepRap machine. Put them aside, make three Opto Endstops, and then you can commence building the extruder.

Wire up a Stepper

First, identify all your wires according to the stepper motor info page.

Then solder or crimp a 4-way 2.54mm-pitch (0.1") socket onto the other four plain coloured wires. The pin numbers are:

Pin (Y & Z axes) Pin (X axis) Name
1 4 A
2 3 B
3 2 C
4 1 D

Yes, the X axis motor runs "backwards". What can I say?

<div class="thumb tright">

Then you can connect it to your Universal Controller Board.

<div class="thumb tright">



When programmed into a PIC16F648, or PIC16F648A (default), the pinouts are:

  1. RA2/AN2/Vref ...... Sync bus connection (A)
  2. RA3/AN3/Cmp1 ...... Sync bus connection (B)
  3. RA4/T0CK1/Cmp2 .... Reserved for LED output
  4. RA5/MCLR/Vpp ...... Maximum optointerrupter input
  5. Vss ............... Ground
  6. RB0/INT ........... Minimum optointerrupter input
  7. RB1/RX/DT ......... RX
  8. RB2/TX/CK ......... TX
  9. RB3/CCP1........... Stepper enable/PWM output
  10. RB4/PGM ........... Stepper output 1
  11. RB5 ............... Stepper output 2
  12. RB6/T1OSO/T1CK1/PGC Stepper output 3
  13. RB7/T1OS1/PGD ..... Stepper output 4
  14. Vdd ............... +5V
  15. RA6/OSC2/CLKOUT ... Not used
  16. RA7/OSC1/CLKIN .... Not used
  17. RA0/AN0 ........... Not used
  18. RA1/AN1 ........... Not used


This board communicates via the Stepper Motor Driver SNAP Protocol v0.