Template:RepRapPro maintenance

From RepRap
Revision as of 13:32, 24 January 2013 by Adrianbowyer (talk | contribs) (Uploading)
Jump to: navigation, search

Uploading new firmware

The firmware is the computer program that resides in the microcontroller chip on the controller printed circuit board. This section tells you how to upload a new copy of that program to your RepRapPro Melzi or Sanguinololu controller.

Important: If you have a multi-colour/multi-material RepRapPro RepRap, then you must first disconnect one end of the 3-way communications wire between the two controllers before you reload firmware into either of them. Reconnect it when you have finished reloading the firmware.

Required software

Downloading from Github

Most of the data you need for RepRapPro hardware and software is on Github. Navigate to the appropriate page.

Then download your software with the button on the left to get it as a .ZIP file:

Reprappro-huxley-get-github-zip.png

Arduino and Sanguino

Get the Arduino IDE from the Arduino website here. It's probably best to use Version 0023 until Arduino 1.0 settles down.

Add the Sanguino files to your Arduino hardware folder. See the README file in that Github repository for instructions.

As a replacement for the Sanguino files, the Gen7 Arduino IDE Support 2.0 (click on "view raw") package is known to be compatible with Arduino IDE 1.0/1.0.1 and also allows to upgrade the CPU clock to 20 MHz.

If you are using Arduino Version 0023 on Mac OS X, in addition to the directions included in the above README, you need to copy the avrdude.conf file included in the Sanguino files zip to the Contents/Resources/Java/hardware/tools/avr/etc directory inside the Arduino package. If you receive the following error when trying to upload the firmware to your board, you will need to edit the avrdude.conf file and remove or comment out the parallel port programmers from line 520 to line 712.

avrdude: parallel port access not available in this configuration
avrdude: error at avrdude.conf:531: programmer type not specified

Git repository

Firmware source code is stored in the RepRapPro git repository. Download the zip file as shown above (the little picture of a cloud with a down-arrow labelled ZIP) and then extract the main folder to your drive. Copy this into your ~/sketchbook folder to make it visible within the Arduino IDE. The Arduino software is much easier to use when it knows where you keep the RepRapPro files, so use File/Preferences to set your preferred location.

Uploading

In order to upload firmware into the controller you need to make sure that the board's reset jumper is installed:

Reprappro-huxley-rest-jumpers.jpg

You can take it off when you have finished uploading. Hang it on one of the pins so it doesn't get lost.


Reprappro-huxley-arduino-upload.png

Launch the Arduino IDE, and use the File | Sketchbook menu to open the Marlin project (or, if you have a milti-material/multi-colour Mendel, the Slave project, depending which firmware you want to upload).

Select the Sanguino board from the Tools | Board menu. You will need to select "Sanguino W/ATmega1284p 16 mhz". (If you can't see the Sanguino boards you will need to check that you have downloaded the right files and moved them to the correct folder - see above).

Ensure the serial port is ticked from the Tools | Serial port menu (the RepRap controller board must be physically connected to your computer with the USB cable at this stage).

Marlin Master Upload

Select the tab for the file Configuration.h. At the top are the following lines:

// Uncomment ONE of the next three lines - the one for your RepRap machine
//#define REPRAPPRO_HUXLEY
//#define REPRAPPRO_MENDEL
//#define REPRAPPRO_WALLACE

// Uncomment ONE of the next two lines - the one for your master controller electronics
//#define REPRAPPRO_MELZI
//#define REPRAPPRO_SANGUINOLOLU

// Uncomment ONE of the next two lines - the one for the series resistors on your controller
//#define SERIAL_R 4700
//#define SERIAL_R 10000

// Uncomment the next line if your machine has more than one extruder
//#define REPRAPPRO_MULTIMATERIALS

Uncomment (i.e. remove the two // characters) from the line corresponding to your machine and your control electronics.

If you have a Sanguinololu controller uncomment the
#define SERIAL_R 4700
line.

If you have a Melzi controller you need to look at the resistor value on the printed circuit board:

Reprappro-mendel-melzi-resistor.jpg

The screw connector at the top of the picture is the one for the hot-end thermistor. Just behind it you can see a small black resistor with 103 written on it. That is a 10K resistor (the last digit is the number of zeros - sometimes it will say 1002, which is obviously also 10K). If your board has that, uncomment the
#define SERIAL_R 10000
line. If it has one labelled 472, uncomment the
#define SERIAL_R 4700
line.

If you have a multi-material/multi-colour or mixer-extruder Mendel uncomment the

//#define REPRAPPRO_MULTIMATERIALS

line.


Further on you will see the following section:

// X, Y, Z, E steps per mm
#define DEFAULT_AXIS_STEPS_PER_UNIT   {91.4286, 91.4286, 4000, 875} 

These four values allow you to store accurate settings for your printer. Once you have calibrated your printer, particularly the fourth value for Extruder steps, you can edit this line.

The values for the X and Y axis are calculated using the following formula: DEFAULT_AXIS_STEPS_PER_UNIT = (Steps per rotation * Microsteps per step) / ( Pulley teeth * Belt pitch). The stepper motors supplied with the kit are 1.8 degree/step motors, which is 200 steps per revolution, and 1/16th microsteps. The pulleys are 14 teeth and the belt pitch is 2.5mm. Thus this figure (200*16)/(14*2.5)=91.4286. If you wish to use 16 teeth pulleys, for example, the figure becomes (200*16)/(16*2.5)=80.

Marlin Master and Slave Upload

To upload your firmware, click the Play button (the first button) to verify that the code compiles correctly, then click Upload (the sixth button with 0023, the second with 1.0) to send the firmware to your processor.


Simple Melzi Test

Having trouble getting uploads to work? Follow these steps...

Here is a short program that should cause the Melzi LED to blink and nothing else:

const int ledPin =  27;
int ledState = LOW;
long previousMillis = 0;
long interval = 1000;

void setup() {
  pinMode(ledPin, OUTPUT);     
}

void loop()
{
  unsigned long currentMillis = millis();
 
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;  
    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;
    digitalWrite(ledPin, ledState);
  }
}

Make sure you are running Arduino version 23 (http://arduino.cc/en/Main/Software) and that you have installed the Sanguino files (https://github.com/jmgiacalone/sanguino1284p).

Leave the main RepRap power supply disconnected.

Connect the power jumper on your Melzi (the one near the middle of the board) for USB power (jumper the two pins of the three on the reset button side), and connect the reset jumper (the one at the etemp connector end of the board). Plug the Melzi USB into your computer and run the Arduino development environment.

Under Tools->Board select "Sanguino W/ATmega 1284p 16 mhz".

Copy and paste the above program into the window and select upload (the button with the right-pointing arrow). If it fails, unplug the USB lead from the computer, wait a few seconds, plug it back in, and try again.

The program should compile then upload, and the on-board LED should then blink at 1 Hz.

Of course, you now have to upload the proper firmware, as described above...

Dismantling the hot end

With care you can completely to dismantle the hot end:

  1. Cut the PLA filament so that you have about 300 mm sticking out of the feed side of the drive.
  2. Loosen the spring screws on the drive (or remove them) so that the filament is not being gripped at all.
  3. Pull the tongue out of the drive to release the brass coupling. Pull the filament through the drive so the PTFE tube and filament are free.
  4. Run the hot end up to temperature, and wait for about 30 seconds.
  5. Push the filament through by hand so that it extrudes slowly. Push about 100mm of filament through to get fresh material right through the hot bit.
  6. Turn the heat off, and watch the temperature as it cools. Clean any extruded filament away from the end of the nozzle.
  7. When it gets down to 100 C, pull the free end of the filament gently but firmly. At that temperature the plastic should be soft enough to come out of the heater assembly, stretching a bit. But it should be coherent enough to hold together; it should all come out, right down to the nozzle, leaving the filament path completely empty.
  8. Disconnect the power and wait for everything to get to room temperature.
  9. Disconnect the hot end wires from the controller board, and slacken the two screws that hold the hot end to the X carriage. Take the hot end off the machine.
  10. Cut the cable ties on the fan heatsink that retain the wires.
  11. Unscrew the fan and heatsink and set them aside.
  12. Unscrew the PTFE cone at the bottom of the nozzle, and set that aside. For the next three steps, take care not to damage the wiring as you unscrew things. Take your time and hold the wires out of the way.
  13. With long-nosed pliers unscrew the brass end of the PTFE tube from the long block. Set the PTFE tube aside.
  14. Unscrew the long block from the short double-threaded stainless steel tube. Set the long block aside.
  15. Retrieve the short length of PTFE from within the counterbored recess in the stainless tube. Set it aside.
  16. Carefully remove the crimps from one end of the thermistor wire and the heater resistor wires.
  17. Pull the heater resistor and the thermistor out from the other end of the aluminium block.
  18. Gently hold the aluminium block in a vice, and use an adjustable spanner on the flats of the brass nozzle to unscrew that.
  19. Unscrew the stainless steel tube, taking care not to damage its threads if you have to grip it.
  20. Clean all residues of PTFE tape from the components.

To reassemble the hot end, follow the instructions on the hot end assembly page for Huxley here and for Mendel here.