DarwinPowerAndCommunicationsCardTest

From RepRap
Jump to: navigation, search

The Power Distribution and Communications Board

The Power Distribution and Communications Board

consists of a power input connector (A) that is the 12v supply for the whole RepRap machine, and an RS232 connector (B) that is the communications link to the computer controlling the machine.  (C) is a power-on indicator LED.  There is a row of seven power output connectors at (D); these are wired into the other circuit boards in the RepRap machine to power them (only five are used for the Darwin design; the other two are spare).  The RS232 signals are converted to and from 5v TTL levels by the chip (G) and its associated capacitors.  The data from (G) to and from RepRap's communications ring is sent and received by the connectors at (E).  (F) is a large smoothing capacitor to keep the 12v supply clean.


File Locations

All the files are in Subversion at svn/reprap/electronics/Comms_and_power_distribution


Build Board

Printed Circuit Board

The above image shows the PCB etched and drilled ready for soldering. The etch mask has been cleaned away from the mounting holes with a cotton bud soaked in alcohol to make soldering easier. This isn't always needed - some etch resists act as a solder flux, and can be left in place and simply soldered over. Whatever happens, don't clean it all off - it will protect the copper.

Files Needed for Printing

Copper Traces Postscript PDF
Component Silkscreen Postscript PDF

Use those and follow the instructions on how to make your own PCBs.

Build Process

Consumables

<iframe src="http://parts.reprap.org/widget/uniqueparts/id/57/bjtemplate/blank" width="100%" height="400" frameborder="1"></iframe>

Note: If U2 is replaced with a MAX202, C2-C5 can be replaced with 0.1uF ceramic capacitors.

Soldering Round 1: Power

Solder in all the components except U2 and its four associated capacitors (C2...C5); that is, solder in all the components with red spots above.

9-pin PCB D connectors come with a variety of ways of attaching them to the PCB in addition to the actual active pins. There are two pads on the PCB to drill out and mount these through, though different designs put the mountings in different places. If your connector coincides with those holes, all well and good. But if it doesn't it may be simplest just to cut/saw-off the mountings and rely on the pins to hold the connector in place. This should be quite strong enough. Make sure you don't short any connections when you modify your connector.


Testing Round 1

Attach 12v power to the power connector (+ on the right in the photo, - or ground on the left)

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.

Soldering Round 2: Communications

Disconnect the power.

Solder in U1 and C2...C5. Take particular care with the capacitors to get the polarity right - check with the circuit diagram which pins on U1 the positive and negative ends go to, and follow the tracks on the PCB. Then check it all again before you next apply power.

Testing Round 2

Re-attach 12v power to the power connector (+ on the right in the photo, ground on the left)

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 shortcircuits 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 Recieve connections also have a ground connection associated with them. These are not normally used; they are to allow us to use screened data wires should the need arise later. The connections you want are the pins labeled T and R, the right of each pair.

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.

(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:

  1. find your tty device
dmesg || grep tty
cat /var/log/messages || grep tty
  1. look at the tty settings. use man stty to find out what each option means.

stty -F /dev/ttyS0

  1. 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 stripboard 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 miswiring of the cable.
  • Pin 15 to 13: 0V. A mismatch suggests a miswired 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 miswiring of the cable.
  • Pin 15 to 13: -7 to -15V. A mismatch suggests a miswired 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 form 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.

Congratulations! You have finished your first RepRap circuit.

Buy Board

  • If you'd like to be added to the suppliers, please contact the RepRap team.

Technical Stuff

Circuit Diagram

Kicad Board Layout

Circuit Discussion

This is based on the older, stripboard comms controller designed by Simon.

P1 is the main 12v power input connector - make this chunky. It can either be a screw connector, or - more elegantly - a plug. The 12v supply is taken straight through (via a big smoothing capacitor) to P4...P10. These are the power distribution lines to the rest of the RepRap PCBs. There are two 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 P2 and P3. 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.

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