RepRapPro Mendel maintenance

From RepRap
Jump to: navigation, search

Introduction | Frame assembly | Y axis assembly | X axis assembly | Z axis assembly | Heated bed assembly | Extruder drive assembly | Hot end assembly | Power supply | Wiring | Commissioning | Printing | Multi‑colour/multi‑materials | Colour Printing - Slic3r | Colour Printing - RepRapPro Slicer | Maintenance | Troubleshooting | Improvements

A notice about these instructions!

Since 1st April 2013, the RepRapPro Mendel has been superseded by the RepRapPro Tricolour and Mono Mendel.
If you are building the new machine, use the official, and most up to date, instructions on the RepRapPro wiki here

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

Arduino IDE

Arduino is the architecture of the main processor/microcontroller (see )

The Arduino IDE (Integrated Development Environment) allows you to upload the firmware to the board. Get it from the Arduino website here.
The latest version of the firmware, Marlin V1.0.4, is proven with Arduino v1.04.

You may also need to install Java.

Sanguino hardware

What is Sanguino?! Sanguino is the basic architecture of the board (see ). Sanguinololu is Sanguino, with the addition of stepper drivers. Melzi is based on Sanguinololu, so needs some extra files so Arduino IDE can talk to the Melzi.

The Sanguino drivers are located within the Marlin folder of the firmware. Copy the 'Sanguino' folder to your /arduino-1.0.4/hardware/ folder.

The 'Bootloader'

At times, you may see references to the 'bootloader'. This is a piece of code that is flashed to the Arduino chip before firmware, to allow basic communications. If you have a RepRapPro machine, this has been done for you. It is part of the Sanguino code, and it tells the chip how to talk to the USB port; without it, it doesn't know how to! Flashing firmware doesn't replace this or require that you flash the bootloader as well; it stays there all the time.

The only reason to reflash the bootloader is if the EEPROM on the Melzi has been completely erased somehow, or if you have replaced the chip on the board.

Git repository

Most of the data you need for RepRapPro hardware and software is in our Github repository. Firmware source code is stored in the RepRapPro git repository for Huxley and monochrome Mendel or RepRapPro git repository for multi-material/multi-colour Mendel.

Downloading from Github

Navigate to the appropriate page for the firmware you need (see above). Then download your software with the button on the top-left to get it as a .ZIP file:


Download the zip file appropriate to your machine as shown above (the little picture of a cloud with a down-arrow labelled ZIP) and then extract the ZIP to your drive. It will create a folder called 'Marlin'. You can move this into your ~/sketchbook folder to make it easily 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 firmware to your Melzi

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


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


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

Huxley / Mendel / Mono Mendel / Tricolour Mendel Master - Marlin Firmware Configuration

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

// Uncomment ONE of the next two lines - the one for your master controller electronics

// 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

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

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


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

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



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 Firmware Upload

To upload your firmware, click the Play button (the first button) to verify that the code compiles correctly. It should respond with:

Done compiling.
Binary sketch size: [XXXX] bytes (of a [XXXX] byte maximum)

If you don't get this, you'll get an error message. Check you installed all the necessary software parts, that you made no errors in the firmware editing, and that you selected the right option under the Tools | Boards and Tools | Serial Ports menus.

Click Upload (the second with 1.0) to send the firmware to your Melzi. A message will show that the firmware is compiling as above, then uploading. Once it has finished, it should say "Done uploading" and the LED will come on on the Melzi.

If you get an error message, try uploading again. Check that you installed the autoreset jumper - it is needed for firmware uploading. Remove it after the firmware has uploaded.

Multimaterials / Tricolour Mendel Slave - Marlin Firmware Configuration

The slave board on a Multimaterials / Tricolour Mendel uses different firmware. In Arduino, open the firmware 'Slave.ino' in the 'Marlin | Slave' folder. No configuration is necessary. Remove the master to slave communication cable, and install the autoreset jumper. Plug the USB cable directly into the slave Melzi, and upload as above.

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;
      ledState = LOW;
    digitalWrite(ledPin, ledState);

Make sure you are running Arduino version 1.04( and that you have installed the Sanguino files.

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.