Microcontroller firmware installation

From RepRap
Revision as of 11:56, 26 November 2009 by Adrianbowyer (talk | contribs)
Jump to: navigation, search
Mendel Build Documentation



Under construction.

Arduino.png

RepRap has a Motherboard that is the overall controller of the machine. Each extruder has a subsidiary controller. The motherboard and extruder controllers have to be programmed. This page tells you how to do that.

Programming the Motherboard

Compiling

The C++ program to be loaded into the Motherboard is in the directory mendel/firmware/FiveD_GCode/FiveD_GCode_Interpreter of the download. The latest version is here in the RepRap Subversion repository, but take care with that - it may be an unstable development version.

In your download directory there is a distribution configuration file called configuration.h.dist. Copy that file to a new file called configuration.h. The reason for this copying is that, when you download a new version of RepRap, you may not want to over-write your personal configuration file.

Run the Arduino Development Environment and load up the sketchbook mendel/firmware/FiveD_GCode/FiveD_GCode_Interpreter/FiveD_GCode_Interpreter.pde. Your new configuration.h file should appear as one of the tabs.

Click on that tab and read through the file. It is extensively commented and gives instructions on what to do to configure the firmware for your particular RepRap setup. When you have edited it, select File->Save.

In the Arduino Development Environment select Tools->Board->Sanguino then select Sketch->Verify/Compile.

The program should compile without errors.

Uploading

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

Check that you have a jumper fitted on the 2-pin connector by C8 on the Motherboard just to the right of the 6-pin connector you're using. It is this jumper that allows the board to be programmed.

Plug a USB cable into the USB-B socket, but don't connect the other end to your computer yet.

Check the list of connections at Tools->Serial Port and note them. Then plug in the USB cable and check the list again - a new entry should have appeared (on Linux it will be something like /dev/ttyUSB0, and on Windows it will be something like COM5). Select that new entry if it hasn't automatically been selected by the Arduino software - it is the USB interface that you just plugged in.

Incidentally - the Power LED on the Motherboard should now be alight. The Motherboard is USB powered.

Select "Upload to I/O Board" (the little square box with the right -> arrow). After a few seconds the debug LED on the Motherboard should flicker - this is the program being loaded into the board.

After a few more seconds the Arduino Development Environment should say "Done uploading" and the debug LED should settle down to a regular pulse at about 2 Hz. That is the RepRap program running on the Motherboard.

If the upload doesn't work, unplug the USB cable, wait a couple of seconds, and plug it back in. Then (with your non-mouse hand) hold down the Motherboard's RESET button. Hover the mouse over the "Upload to I/O Board" box, release the RESET, then almost immediately click the mouse.

Programming an Extruder Controller

The procedure for this is very similar to that for programming the Motherboard.

Compiling

The C++ program to be loaded into Extruder Controllers is in the directory mendel/firmware/FiveD_GCode/Extruder of the download. The latest version is here in the RepRap Subversion repository, but take care with that - it may be an unstable development version.

In your download directory there is a distribution configuration file called configuration.h.dist. Copy that file to a new file called configuration.h. The reason for this copying is that, when you download a new version of RepRap, you may not want to over-write your personal configuration file.

Run the Arduino Development Environment and load up the sketchbook mendel/firmware/FiveD_GCode/Extruder/Extruder.pde. Your new configuration.h file should appear as one of the tabs.

Click on that tab and read through the file. It is quite short. The comments give instructions on what to do to configure the firmware for your particular extruder setup. When you have edited it, select File->Save.

In the Arduino Development Environment select Tools->Board->Arduino Diecimila or Duemilanove w/ ATmega 168 then select Sketch->Verify/Compile.

The program should compile without errors.

Uploading

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

Plug a USB cable into the USB-B socket, but don't connect the other end to your computer yet.

Check the list of connections at Tools->Serial Port and note them. Then plug in the USB cable and check the list again - a new entry should have appeared (on Linux it will be something like /dev/ttyUSB0, and on Windows it will be something like COM5). Select that new entry if it hasn't automatically been selected by the Arduino software - it is the USB interface that you just plugged in.

Incidentally - the Power LED on the Extruder Controller should now be alight. The Extruder Controller is USB powered for programming, and self-powered when it is running from its 12 volt supply. You may find that some of the other LEDs light as well - this is fine.

Select "Upload to I/O Board" (the little square box with the right -> arrow). After a few seconds the debug LED on the Extruder Controller should flicker - this is the program being loaded into the board.

After a few more seconds the Arduino Development Environment should say "Done uploading" and the debug LED should go out.

If the upload doesn't work, unplug the USB cable, wait a couple of seconds, and plug it back in. Then (with your non-mouse hand) hold down the Extruder Controller's RESET button. Hover the mouse over the "Upload to I/O Board" box, release the RESET, then almost immediately click the mouse.



See also the Generation 3 Firmware page.

Return to How to make RepRap Version II Mendel.