Testing RepRap Electronics

From RepRap
Revision as of 18:00, 29 November 2009 by Adrianbowyer (talk | contribs) (Testing a Stepper Driver)
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.

Testing the Motherboard

Motherboard-programming.jpg

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

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 blue to the left connector). 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

Turn the current control potentiometer on the stepper driver board fully anticlockwise, and then bacK quarter of a turn.

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).

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 XXX mm 10-way ribbon cable with the two insulation-displacement connectors (IDCs). 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 (disconnected) 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 its got to -250.)

Testing an Optoswitch