Testing RepRap Electronics

From RepRap
Revision as of 10:02, 4 January 2010 by Adrianbowyer (talk | contribs) (Testing an Optoswitch)
Jump to: navigation, search

This page describes how to test each circuit board used by RepRap on the bench before fitting it to the machine. The circuits are pretty robust and hard to damage. But one thing that will break them is getting power connections backwards. Always double check the power polarity before turning any board on for the first time.

Testing the Motherboard

Motherboard-programming.jpg

The Motherboard must have its program loaded into it before it can be tested. See here for how to program the Motherboard.

Plug the USB<->serial cable you made up on this page into the six-pin connector on the left edge of the Motherboard as shown. Make sure you get it the right way round. The RTS connection (which you should have coloured green) goes to the top end of the Motherboard connector labeled "GRN". The ground connection (coloured black) goes at the bottom, labeled "BLK".

Run the RepRap program on your computer (see here if you can't remember how). Select Preferences->Globals->CommsDebug and set it true. In the console window you should see the following scrolling continuously:

comms: G-code: M105 dequeued and sent [0.002s/-1259516051264ms]
comms: GCodeWriter.waitForOK() - temperature reading: T:0 [0.017s/15ms]
comms: GCode acknowledged with message: ok EB [0.017s/0ms]
comms: G-code: M105 dequeued and sent [1.519s/1502ms]
comms: GCodeWriter.waitForOK() - temperature reading: T:0 [1.537s/18ms]
comms: GCode acknowledged with message: ok EB [1.537s/0ms]

This is the RepRap program polling the Motherboard for the temperature of the extruder. Of course, there is no extruder, so it reports back 0 and an error code (the EBs - that means timeout on the RS485 communications between the Motherboard and the - as yet non-existent - extruder controller).


Testing an Extruder Controller

Extruder-controller-test.jpg

An extruder controller must have its program loaded into it before it can be tested. See here for how to program an extruder controller.

Connect the Motherboard up as above. Beside it, connect the extruder controller to a 12 volt supply (+ve to the right of the power connector in the picture - the red wire; -ve is the blue wire to the left connector). Check the polarity before applying power. Flick the 12 volt supply on and then off and check that the extruder controller's power LED flashes.

Wire two jumper leads between the RS485 connections on the two boards. Connect the same pin to the same pin on each (i.e. don't make a crossover).

Don't turn the 12 volt supply on just yet.

Run the RepRap program as in testing the Motherboard above. You should see the same responses scrolling up the console window.

Now turn on the 12 volts to the extruder controller. It will boot up and start responding to the RS232 requests for a temperature value:

comms: G-code: M105 dequeued and sent [9.140s/1502ms]
comms: GCodeWriter.waitForOK() - temperature reading: T:0 [9.158s/18ms]
comms: GCode acknowledged with message: ok EB [9.158s/0ms]
comms: G-code: M105 dequeued and sent [10.660s/1502ms]
comms: GCodeWriter.waitForOK() - temperature reading: T:0 [10.677s/17ms]
comms: GCode acknowledged with message: ok EB [10.677s/0ms]
comms: G-code: M105 dequeued and sent [12.179s/1502ms]
comms: GCodeWriter.waitForOK() - temperature reading: T:499 [12.197s/18ms]
comms: GCode acknowledged [12.197s/0ms]
comms: G-code: M105 dequeued and sent [13.699s/1502ms]
comms: GCodeWriter.waitForOK() - temperature reading: T:499 [13.717s/18ms]
comms: GCode acknowledged [13.717s/0ms]
comms: G-code: M105 dequeued and sent [15.219s/1502ms]
comms: GCodeWriter.waitForOK() - temperature reading: T:499 [15.237s/18ms]

Of course, there is no temperature sensor attached, so you get a silly value back (the 499 oC). But this confirms that both boards are working and talking successfully via their RS485 link.


Testing a Stepper Driver

Stepper-test.jpg

The Motherboard must have its program loaded into it before it can be used to test a stepper driver board. See here for how to program the Motherboard.

Turn the current control potentiometer (bottom right on the picture) on the stepper driver board fully anticlockwise, and then back quarter of a turn clockwise.

Connect a 12 volt power supply to the stepper controller board. The +ve connection is on the right in the picture (red); the -ve is on the left (blue). Double-check that you've got the polarity the right way round.

With nothing else connected flick the power on then off and check that the board's power LED flicks on too.

Make up (if you haven't already) an 610 mm 10-way ribbon cable with two 10-way insulation-displacement connectors (IDCs - this cable will be used as the Z-stepper cable on the final machine). The tabs on the connectors go the same way round. That is to say, if you lay the cable out straight with the connectors on, the tabs both point the same way. Use the 10-way connector to connect the board to the X output of the Motherboard.

Put a jumper on the stepper board where the MIN opto-switch will connect. It is across the top two pins as shown in the picture. This pretends to the control system that there is an opto-switch connected, and that it is untriggered (that is, it's pretending that the axis is not at the end of its travel).

Leave the stepper motor disconnected at this stage.

Connect the Motherboard via the USB cable to your computer and run the RepRap software.

Turn on the 12 volt supply. Some of the LEDs by the stepper connector may come on.

Xyz.png

Select the XYZ tab on the control panel, select a nudge length of 10 mm, slow the feedrate to 300 mm/min and click the right arrow of the X-axis control. You should see the LEDs by the stepper connector flicker. This is the stepper driver chip energising the (not yet connected) coils of the motor. Click the left arrow. The LEDs should flicker again.

Exit the program, turn everything off, and pull the USB plug.

Connect a stepper motor. The sequence is A = blue, B = red, C = green, D = black. Put a blob of Blu-tack on its shaft so you can easily see it rotating.

Plug the USB back in, turn the 12 volts back on, and run the program again.

Now when you select the arrows the motor should turn forwards and backwards. If you select Home to zero the axis the motor should spin then stop if you pull the jumper off. (Note it won't spin forever if you don't. The software just drives the axis to an imaginary point of x = -250. This is wider than the axis, so it's always enough to zero it wherever it is. But the spin will stop when the controller thinks it's got to -250.)


Testing an Optoswitch

Opto-test.jpg

The setup for this is virtually identical to that for the stepper driver test above.

Make up (if you haven't already) an 420 mm 3-way ribbon cable with two 3-way insulation-displacement connectors (IDCs - this cable will be used as the Z optoswitch connector on the final machine). Use this to connect the opto-switch to the MIN connector on the stepper driver board.

Check the power connections to the opto-switch with a multimeter. The GND connection should go to the ground on the stepper driver board (the easiest place to find this on the board is the two-way power connector; it's the left-hand connection - blue wire - in the picture). The VCC connection should go to the left-hand terminal of the 7805 voltage regulator on the stepper driver board. Make sure you check this polarity before switching on.

Run the stepper test above. Now when you Home the motor, it should stop when you put something opaque in the opto-switch slot (a screwdriver blade works well). If you try a bit of plastic you will be surprised at how many plastics are IR-transparent...