Power Distribution and Communications Board v1.3

From RepRap
Jump to: navigation, search


<div class="thumb tright">
Cache-2053732676 7c5a08390e.jpg

The Power Distribution and Communications Board consists of a hard drive style power input connector that is the 12v supply for the whole RepRap machine, and an RS232 connector that is the communications link to the computer controlling the machine. There is a power-on indicator LED and 4 Tx/Rx indicator LEDs. There is a row of power output connectors. These are wired into the other circuit boards in the RepRap machine to power them (only five are used for the Darwin design; the others are spare). The RS232 signals are converted to and from 5v TTL levels by the MAX232 chip and its associated capacitors. The data from to and from RepRap's communications ring is sent and received by the Rx/Tx connectors. There are 2 large, power smoothing capacitors to keep the 12v supply clean.

Get It!

Raw Components

  1. Buy the PCB from the RRRF
  2. Buy the components with ease


You can download the electronics files from Sourceforge. This zip file contains the Kicad files, as well as the GERBER files you can use to build it yourself (or have it manufactured).


<div class="thumb tright">
Cache-2053732588 8a2aeed942.jpg

DB9 Connector

This is a standard 9 pin serial connector. You will need a cord with a male serial plug on it. If you don't have an actual serial port on your computer, we recommend you use a USB to Serial converter. It works just fine.

Tx / Rx

These are the output and input pins. Tx stands for 'Transmit' and Rx stands for 'Receive'. On each set of pins, the leftmost pin is connected to Ground, and the rightmost pin is the pin that actually carries the data. It's recommended to connect both pins as it will reduce noise in your system.

NOTE: We messed up and the Rx and Tx silkscreens have been REVERSED! Rx is actually Tx and Tx is actually Rx. Sorry!

Power In

This is a 4 pin Molex power connector. It is very standard. You can simply plug a disk drive power connector from pretty much any PC power supply into here to power your board.

Power Out

These are power outputs. Each output supplies 12v in power. Each one is clearly marked with +/- signs denoting polarity. Its a good idea not to short them out.

Circuit Board

<div class="thumb tright">
Cache-2053733154 7f8abe4676.jpg

You can either buy this PCB from the RepRap Research Foundation, or you can make your own. The image above shows the professionally manufactured PCB ready for soldering. Its also cheap, only $5.00 USD.


<div class="thumb tright">
Cache-2053731494 959f95c553.jpg

Refer to the parts list generator for information on where to get the parts you need

<iframe width='700' height='450' frameborder='0' src='http://spreadsheets.google.com/pub?key=pmEMxYRcQzzATwbOb71BmGA&output=html&gid=19&single=true&widget=true'></iframe>

Board Bugs

Silkscreen Oops!

We messed up and the Rx and Tx silkscreens have been REVERSED! Rx is actually Tx and Tx is actually Rx.* Sorry!

If you find any more bugs, please let us know in the forums.

Build Process

<div class="thumb tright">
Cache-2053731624 ffabd15cea.jpg


This is the 560 ohm resistor. It can be soldered in any orientation.

<div class="thumb tright">
Cache-2053731708 c25dedd59a.jpg

R2, R3

These are the 1.8K ohm resistors. They can be soldered in any orientation.

<div class="thumb tright">
Cache-2052946751 ee6bf121e7.jpg

R4, R5

These are the 5.6K ohm resistors. They can be soldered in any orientation.

<div class="thumb tright">
Cache-2053731878 0dd34f80ef.jpg

D4, D5

These are the bi-colour LED's. They contain 2 LEDs, wired in opposite directions. Solder the longer leg into the square solder pad, and the short leg into the round solder pad. If you mess it up, you will simply have red as your default on-color, and green as your 'activity' colour.

<div class="thumb tright">
Cache-2053731972 ba955a2836.jpg

DIP Socket

This is the socket for the MAX232 chip. Line the semicircle on the socket up with the corresponding mark on the silkscreen. Insert the socket, flip the board over and bend a couple pins to hold the socket into place. I like to bend pins at opposite corners. This will make it easier to solder in. Then solder every pin.

<div class="thumb tright">
Cache-2052946991 7f4e8f5502.jpg


This is the 78L05, the voltage regulator. The flat side should face the upper left side of the board and match the long flat part of the silkscreen.

<div class="thumb tright">
Cache-2052947077 494ec9490e.jpg

D1, D2, D3

These are the main LED's for the board. They are to indicate power, Tx activity, and Rx activity. LED's have polarity, so you'll need to insert them in the correct orientation. The long leg of the LED is the positive end and should be inserted into the square pad on the PCB.

<div class="thumb tright">
Cache-2053732176 16d0238636.jpg


This is the 4 pin Molex power connector. When you insert it, make sure the angles on the inside of the connector part match the angles on the silkscreen.

<div class="thumb tright">
Cache-2053732322 4104904577.jpg

C7, C9

These are the 100nf (0.1uF) ceramic disc capacitors. They should say '104' on the side. Insert them in any orientation and solder them in.

<div class="thumb tright">
Cache-2053732404 0dab67e289.jpg


These are the electrolytic capacitors. They have a specific polarity. You will want to make sure you solder them in facing the correct way. Most will have a stripe running down one side with a negative sign on it. This is the negative lead. Solder it into the circular hole. Look at the picture to your right if you are unclear.

<div class="thumb tright">
Cache-2053732456 b5faed2817.jpg

P2, P3

These are the connectors for the Tx and Rx pins. Insert them with the tab facing the inside of the board.

<div class="thumb tright">
Cache-2053732544 b7fdaaa511.jpg


This is the DB9 connector. If you purchased the one specified in the BOM, simply insert the pins into the correct spots and push until the tabs lock it into place. Flip it over and solder those tabs to their holders (using plenty of solder... it will form a big blob over the hole. After that, solder each pin individually. Be careful not to bridge any pins together.

(I accidentally skipped this step in the instructions, that's why you see the power pins in the background. oops!)

<div class="thumb tright">
Cache-2053732512 c2fc663ea1.jpg

P4 - P10

These are the power output headers. Solder each one in with the tab facing the inside of the board.

This step is optional if you are using this board with the Arduino based electronics.

<div class="thumb tright">
Cache-2052947647 55b53feac7.jpg


This is the power smoothing capacitor. Make sure you get the polarity right. It is the same as the electrolytic capacitors we used earlier, except bigger. The positive and negative pads are clearly marked on the silkscreen.

This step is optional if you are using this board with the Arduino based electronics.

<div class="thumb tright">
Cache-2053732676 7c5a08390e.jpg


This is an extra power smoothing capacitor. Technically this is completely optional, and you only need it if your power supply is very unreliable. However, it won't hurt and it does make your board look much better. Same directions as above.


Test 1: Power

<div class="thumb tright">
Cache-2053732702 95851c585c.jpg

For this first test, do not put the MAX232 chip U2 into its socket. Leave that socket empty. Plug a disk drive power connector from your power supply directly to the board. Turn the power supply on.

Check for smoke. The RepRap is a non-smoking area. If there's smoke, something went wrong.

Is there light? Check that the LED lights up. If it doesn't, you've made a mistake.

Proper voltages? Next put a voltmeter on the tracks that will connect to pins 15 and 16 of U2. This should measure 5v from the voltage regulator U1. If it doesn't, you've made another mistake.

Test 2: Communications

<div class="thumb tright">
Cache-2052947871 d9f313fd56.jpg

Disconnect the power supply from the board. Insert the MAX232 chip into its socket U2, being careful to match the semi-circular notch in one end of it with the similar notch in the socket. Plug your power back in and turn the power supply on. Insert your USB -> Serial adaptor into the PowerComms board. If everything is okay then insert it into your computer.

In this new version of the board, there are bicolor LED's on the lines coming directly from your serial port. By default, they should always be on (in green). If they do not both light up, double check that your cord from the PC is fully inserted at both ends.

The next step is to connect the Tx on the board to the Rx. In both of the connectors, the left pins are ground, and the pins on the right are the actual data transmission lines. Connect them both.

Communications Test
A simple text communications program like minicom on Unix or Hyperterminal on Windows transmits data from the keyboard down the RS232 line. Data that comes back appears on the screen. This means that whatever the RS232 port is connected to normally has to echo what you type for it to appear on the screen.

This test short-circuits that process by wiring the output straight back to the input. But they both go through U1, so that tests the communications part of the board.

Both the Transmit and Receive connections also have a ground connection associated with them. These are not normally used; they are to allow us to use twisted pair data wires should the need arise later. The connections you want are the pins labelled T and R, the right of each pair. If you want, you can wire up a test connector that shorts them when you plug it into both.

Connect the card to the serial port of your computer. Then, short the transmit (T) and receive (R) lines that would normally go to the token ring. Now, check that a terminal program (like minicom or Hyperterminal) echoes data to its screen when you type. As you do this, all 4 LEDs should blink as you type data. This means you're successfully transmitting data! Yay!

(In the finished RepRap machine T goes to the recieve input of the first RepRap control board - usually the X axis; R comes from the transmit output of the last RepRap control board - usually the support material extruder.)

Debugging your serial connection

DarwinPowerAndCommunicationsCard-DB9F 232Pinout.jpg

Experienced hardware folk never trust their hardware. First make sure your serial port operates, which is easily done by shorting the Rx and Tx lines out on the serial lead from your PC. These are pins 2 & 3 and a small screwdriver will do the job. Do not touch the other pins or the casing. With the other arms, type characters at a dumb serial terminal such as Hyperterminal (Windows), minicom (Linux) or Kermit (Linux) which has had all flow control turned off. If the port works, your typing should echo back - and stop echoing when you remove the screwdriver. If it doesn't work, you have the wrong port, a dead lead, a dead port, or if really unlucky a combination of the above. In Linux the serial ports are referenced via ttyS0 (for COM1) and ttyS1 (for COM2), or ttyUSB0 (for USB <-> serial connectors). You can check which ports were detected by running one or more of the following:

find your tty device

dmesg || grep tty
cat /var/log/messages || grep tty

look at the tty settings. use man stty to find out what each option means.
stty -F /dev/ttyS0

for my usb serial adaptor, i had to turn off imaxbel (beep and do not flush a full input buffer on a character)
stty -F /dev/ttyUSB0 imaxbel

When testing with comms software ensure flow control is set to "none". If in doubt for the other settings, use the following (though it's not too important at this stage): 19200 baud, 8 bits, no parity, one stop bit (8-N-1). If available, set carrier-detect to off.

Use the same principle to test the connector to the board, shorting it out with a screwdriver while no power is applied is acceptable. The pins to short are pins 2 and 3 of the serial connector on the module board (while the cable is still attached to the PC). If that doesn't work, your cable is suspect.

If all this checks out and you have verified the strip-board soldering, then you can apply power to the board. If you have a multimeter, check the following voltage levels are present. If any of these are wrong it suggests a defect in your wiring. In each case, measure from the first pin with the negative input of your voltmeter to the second pin with the positive input of your voltmeter. For these measurements, plug the power in, but do not plug the device into the PC. Also leave the communications connectors empty.

  • Pin 15 to 16: 5V. A mismatch suggests a power supply or 7805 issue.
  • Pin 15 to 14: -7 to -15V. A mismatch suggests a short on the board or a miss-wiring of the cable.
  • Pin 15 to 13: 0V. A mismatch suggests a miss-wired cable.
  • Pin 15 to 12: 5V
  • Pin 15 to 11: 4 to 4.5V.

Now plug the serial connector into the PC (still leaving the communications connectors empty). You should now measure the following:

  • Pin 15 to 16: 5V. A mismatch suggests a power supply or 7805 issue.
  • Pin 15 to 14: -7 to -15V. A mismatch suggests a short on the board or a miss-wiring of the cable.
  • Pin 15 to 13: -7 to -15V. A mismatch suggests a miss-wired cable.
  • Pin 15 to 12: 5V
  • Pin 15 to 11: 4 to 4.5V.

Now get a module connector cable (which is either 3 or 4 wires depending on how you're constructing your modules) and connect J2 to J3. This makes the comms card behave as if it is addressing other controller cards. Be sure that you don't get your cable twisted when you connect J2 to J3. Doing so shorts your 12V pin directly to ground, a move that is unlikely to do your power supply a lot of good.

Alternatively, you can simply attach a jumper wire from pin 1 on the outgoing comms connector (J2) to pin 1 on the incoming communications connector (J3). Take great care not to get your connector cable twisted.

You should now observe the following:

  • Pin 15 to 11: 5V (rather than somewhere from 4 to 4.5V)

At this stage you should be able to do an internal echo test.

Using your comms software and the same settings as you previously used (no flow control), type or send some characters. The exact same characters should echo back to you. If you remove the power from the module, the echo should stop. Turn it on again and check that echo returns. Similarly, if you remove the comms cable echo should stop, put it back it and check that echo returns.

For Linux you can also use the 'poke' utility from the firmware toolkit to test the interface. I used device /dev/ttyUSB0 - a serial USB adaptor - as my serial port on a Linux box, Windows users probably have COM1 or something similar. Here is the command line; change your device to match and make sure you have access rights to that device (in Ubuntu you must be a member of the system dialout group):

echo 0||./poke -d 2 -t /dev/ttyUSB0 -v -w

It should come back with: <54><51><31><02><00><00><d0>[54][51][31][02][00][00][d0]Read fail 2 <54><51><31><02><00><00><d0>[54][51][31][02][00][00][d0]Read fail 2 <54><51><31><02><00><00><d0>[54][51][31][02][00][00][d0]Read fail 2 <54><51><31><02><00><00><d0>[54][51][31][02][00][00][d0]Read fail 2

If this does not happen, type:

stty -F $serialport -echo -cooked

and try again.

For Windows the poke utility is not currently available. You can use the Java stepper exerciser application instead. If you launch it and drag one of the position sliders, you should see the following error: Update exception: java.io.IOException: Received data packet when expecting ACK

Now you are ready to build and connect your stepper controller board.

More Debugging Instructions

Technical Stuff

Circuit Discussion

P1 is the main 12v power input connector - it uses a header that you can plug a standard PC power supply into. The 12v supply is taken straight through (via a big smoothing capacitor) to P4. These are the power distribution lines to the rest of the RepRap PCBs. There is one spare - you only need five for the Darwin design.

DB9 is a female PCB-mounting 9-pin RS232 socket. Serial data from your computer comes in here, is converted to TTL voltage levels by U2, and is fed out to the rest of the RepRap PCBs via Tx and Rx. Remember that RepRap communicates using a token ring, so only two connectors are needed for data. U2 gets the 5v power it needs from U1.

Note that it has large ground and 12v planes on the board. This both saves etching chemicals and also handles the current needed by all the other RepRap boards.

There are 4 diagnostic LED's on this board: 2 big, green LEDs for the TTL Tx and Rx, and 2 small bi-colour LED's which switch between green and red to indicate Tx/Rx activity directly from the RS232 connection. They should operation in unison.

Finally there is an indicator LED so you can remember when you've left your RepRap switched on.



Schematic Changes

  • Add debug LED's to TTL Tx/Rx lines (nophead)
  • Add debug LED's to RS232 Tx/Rx lines (nophead)
  • Add extra capacitor to filter out high frequency noise as per data sheet (nophead)
  • Figure out bug with 78L05 and cvpcb failing. (Zach Smith)
  • Change power connector to 12v/G alternating connectors. (Zach Smith)
  • Swap 4700uF capacitor for two 2200uF capacitors (Simon McAuliffe)
  • C7 needs to become a 0.1uF (doubled)
  • C9 next to c8 and C6 as a 0.1uF (doubled)

PCB Layout Changes

  • Placed C7 above the regulator to get the track to pin 1 as short as possible. then move R2 to where C7 was.
  • Move RS232 led's closer to control lines
  • Move Tx/Rx LED's to each side of their respective connections.
  • Insert new capacitor near 5v regulator
  • give the .100" connectors a proper silkscreen for Tx/Rx as well as power.
  • Fastener holes: ensure clearance fit for 1/8" (3.125mm) diameter shank (Imperial equivalent of M3). Dia 3.5mm should do it.
  • Fastener washer space: ensure circuits avoid the radius of an M3 washer on the fastener holes (metal washers might short the circuit).
  • The C6/C8 capacitors are to spec as per the Mouser datasheet.
  • Move 1uF capacitor closer to MAX232
  • Make .100" holes slightly bigger
  • Make make Molex holes to spec.
  • Double check silkscreens
  • The pitch for the resistors is too small. I use 0.4". The picture of the 1.2 board on the wiki shows the only resistor half in the air because it does not fit the 0.3" footprint properly.

Previous Versions