Category Archives: How to…

Notes on Marlin – Auto Bed Levelling

Upon enabling the auto bed levelling feature of the Marlin firmware I learned a thing or two through trial and error and wished it had been better documented so I’ll try and let you know what I’ve learned.

Here are links to some useful information that all helped me get setup:

Firmware setup
Hardware setup
PrintrBoard setup

In the Marlin firmware, where you set the left, right, back and front positions for probing, do not set the left and front positions below 10.  I tried 5 (assuming the bigger the test area the better results you would get) and wondered why moving the nozzle back to X0 Y0 after homing resulted in the nozzle crashing both X & Y in to the min endstops.  I quickly noticed that at the start of the probing both the nozzle did not move in either X or Y so they were both then 5mm out when homing after the probing.  I now use 20 for left and front.

I also found that if you just move X & Y to home before probing and your nozzle is quite high in relation to the bed then the bed probe would stop way before it even touched the bed.  I thought I’d fix this by homing the Z before probing but you need to make sure that the probe is within your bed probing co-ordinates (i.e. the middle of the bed, or at least more than you’ve set for left and front).

So here is my start G-Code* that I’ve put in to Slic3r:

G28 X0 Y0 ;home X & Y
G1 X100 Y100 F5000 ;move nozzle to centre of bed
G28 Z0 ;home Z
G29 ;probe bed
G90; set absolute coordinates
G92 E0; reset extruder distance
G1 Z5 F300 ;move nozzle up 5mm for safe homing
G1 X0 Y0 Z0 F5000; move nozzle to home

*If you’re going to use this code then please set your own bed centre and move velocities appropriate to your printer.

If I discover anything more on this topic then I’ll update this post.

Tagged , ,

Hot-End & Bed Calibration

In the quest to fine tune our printers I found a very good guide on how to calibrate the PID control of the Hot-End and the Heated Bed.

If you find that your hot-end temperature fluctuates more than you’d like it to or that it over-shoots or stops short of the set temperature then this is for you.

Again, the source of this information comes from Lincomatic but this time there was a great summary found HERE

The Process:

  1. Allow your hot end to cool to room temperature
  2. In Pronterface or Repetier, send the command: M303 Snnn (where nnn = the temperature you’re extruding at, eg 230 for ABS would be M303 S230)
  3. Wait whilst the printer ramps up and down the hot-end temperature
  4. Input results into your Firmware

The results you get back will look something like this:

bias: 101 d: 101 min: 145.48 max: 154.02
Ku: 64.06 Tu: 29.67
Clasic PID
Kp: 38.04
Ki: 2.35
Kd: 147.63

Input the last 3 sets of numbers into your firmware here:

#define DEFAULT_Kp 38.04
#define DEFAULT_Ki 2.35
#define DEFAULT_Kd 147.63

You can also do the same for the heated bed by using M303 E-1 Snnn (where nnn is the temperature you normally run the bed at, eg M303 E-1 S60)

Tagged ,

Extrusion Calibration v2

After re-reading Triffid Hunter’s calibration guide I was specifically curious about the final comments about volumetric extrusion which makes sense as we are dealing with something that has volume.

You can read up on the process and the rationale behind it HERE

Put simply:

  1. Set the filament diameter to 1.128379 and never change it
  2. Set the extrusion multiplier to 1 and never change it
  3. Divide your E-Steps by 7 for 3mm filament or 2.4 for 1.75mm filament
  4. Multiply your E related speeds, accelerations and retractions by 7 for 3mm filament or 2.4 for 1.75mm filament
  5. In Sli3r multiply the Retraction Length and Retraction Speed by 7 for 3mm filament or 2.4 for 1.75mm filament

Multiply the E settings by 7 for 3mm filament or 2.4 for 1.75mm filament in the Marlin firmware in the following lines:




The only calibration you will then make is by altering the E-Steps.  You can alter this mid-print by either sending gcode M92 Ennn (where nnn = the new E-Steps number) or by adjusting it on the printer’s LCD control panel.

You can either calibrate the E-Steps by visual inspection where you’re looking for gaps in the infill at 95% and with no gaps on a solid fill or after slicing a single wall cube with no infill look in the gcode for the perimeter width, print it halfway and then measure the wall width.


Tagged ,

Extruder Calibration – [UPDATE]

Until recently I had not found a method of calibrating the amount of extrusion required for a good print which has worked well for me.

Well…. All that has change since I stumbled upon this post: HERE

Of course I calibrate the extruder stepper like most people do (see Slic3r is Nicer) but I still had to fudge around with the Filament Settings / Extrusion Multiplier and the Printer Settings / Advanced to get something that resembled a ‘nice’ print.

I would change the Advanced settings from their default, print something and then change again and again until the print looked right as I had never found a good guide for setting up Slic3r.


Since I’ve been using this technique for a few weeks I wish to share what extra bits I’ve learnt.

When Calibrating make sure you set the extruder to slow down when print time is below 0 sec.  I found it difficult to get a good calibration when the walls were made with a slow moving head so this makes sure the head DOES NOT slow down.

Set First Layer to 200% for good adhesion.

Set Infill to 125% to fill in any gaps in the top layer.]

So, from the “Solidoodle Tips” post I know that the Default Extrusion Width should be 1.4 times the layer height (eg. Layer height = 0.3 then Extrusion Width = 0.42) (0.2 = 0.28)

To then calibrate the extrusion:

  • Create or change your settings in Slic3r to use for this test:

Layer Settings: (click the picture for a larger version)

Layer Settings





Filament Settings: (obviously don’t copy my Diameter or temperature settings, just the Extrusion Multiplier)

Filament 1

  • Download / design a small (eg. 20 x 20 x 20mm or try this) cube.  Print with the settings as shown above.  We are trying to print a wall which is a single line of filament thick so minimum perimeters is set to 1 and Fill Density (infill) set to zero.  This will give us a single wall hollow cube.  Stop the print when it has printed halfway up the cube as we want to measure the thickness of the wall.
  • Measure actual printed wall thickness will digital callipers.
  • If you’ve printed at 0.3mm layer height this SHOULD read 0.42mm (the width you’ve told Slic3r to print).
  • If not (mine printed 0.55mm!!) then divide what it should be by what you’ve measured.  0.42 / 0.55 = 0.7636363636 for example
  • Copy and paste the total into the Extrusion Multiplier: (I rounded the number)

Filament 2

Print the cube again and re-measure.  If it’s still not quite right then divide the Extrusion Multiplier by the measured thickness, then times by what it should be.  (0.7636363636 / 0.44) * 0.42 = 0.72892561983471 for example.

I know this isn’t that straight forward but I wish I had found this method a long time ago!  Thanks go to Ian Johnson over at Solidoodle Tips, he’s got a great website there full of VERY useful information to help you with your prints.

Hope this helps, let me know if it does or if you’d like any further information. Thanks.

LCD and Encoder controls (Panelolu) – – – – – – – Part 1, Software

I’d like to first thank the people over at for all the hard work they’ve done in providing most of the work in connecting an LCD and encoder to the PrintrBoard. I’m re-posting this information using the code that works for my PrintrBoard I use on my MendelMax. If this helps you with your machine then please leave a comment.

This code should work with any PrintrBoard connected to either a MendelMax, Printrbot or any 3D printer where you’re using Marlin firmware.

This post has 2 parts, this, the Software part and part 2, the Hardware part which will show the wiring diagrams for the LCD and controls.

The examples given will be using the latest version (at the time of writing) of the Marlin firmware.  Download it HERE

You must first prepare the files Configuration.h and pins.h within the firmware to access the LCD and encoder.


line 48-50

  #define MOTHERBOARD 81

line 78-81

#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 -1
#define TEMP_SENSOR_2 -1

line 216-218

const bool X_ENDSTOPS_INVERTING = false; //set to true to invert the logic of the endstops
const bool Y_ENDSTOPS_INVERTING = false; //set to true to invert the logic of the endstops
const bool Z_ENDSTOPS_INVERTING = false; //set to true to invert the logic of the endstops

line 275 – Obviously change these values to your own printers configuration.

#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200*8/3,760*1.1}

line 279-283 – Not necessary but I like to slow down the acceleration for less ringing when changing direction.

#define DEFAULT_ACCELERATION 1500 //X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 3000 //X, Y, Z and E max acceleration in mm/s^2 for r retracts
#define DEFAULT_XYJERK 12.0

line 302-307

//LCD and SD support
//#define ULTRA_LCD //general lcd support, also 16x2
#define SDSUPPORT // Enable SD Card Support in Hardware Console
#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
//#define ULTIPANEL //the ultipanel as on thingiverse

line 961

#define FAN_PIN            22  // Fan

line 973 – To enable SD card support you must move the Y-endstop to the E-endstop pins (see previous post)

#define Y_STOP_PIN         37

line 989-994

  // these pins are defined in the SD library if building with SD support
    #define SCK_PIN          21  // 9
    #define MISO_PIN         22  //11
    #define MOSI_PIN         23  //10

line 995 add the following

#ifdef ULTRA_LCD
 #ifdef NEWPANEL
  //we have no buzzer installed
  #define BEEPER -1
  //LCD Pins
  #define LCD_PINS_RS        41
  #define LCD_PINS_ENABLE    1
  #define LCD_PINS_D4        11
  #define LCD_PINS_D5        9
  #define LCD_PINS_D6        6
  #define LCD_PINS_D7        4

  //The encoder and click button
  #define BTN_EN1 2  //must be a hardware interrupt pin
  #define BTN_EN2 3  //must be hardware interrupt pin
  #define BTN_ENC 0  //the click

  //not connected to a pin currently
  #define SDCARDDETECT -1

  //from the same bit in the RAMPS Newpanel define
  //encoder rotation values
  #define encrot0 0
  #define encrot1 2
  #define encrot2 3
  #define encrot3 1

  #define BLEN_C 2
  #define BLEN_B 1
  #define BLEN_A 0
 #endif //Newpanel
#endif //ULTRA_LCD

Upload this firmware to your PrintrBoard (how-to).

Once updated restart your PrintrBoard. If you have the LCD connected then it should display data about your printer. If you haven’t connected the LCD to your PrintrBoard yet then it’s worth attempting to connect your computer to the PrintrBoard to make sure everything is still working correctly.

Tagged , , , ,

PrintrBoard SD Card & Boot-up fix

I had some trouble using the PrintrBoard’s built in SD card reader using Marlin firmware. I also had an issue with the Y-endstop, which I thought was unrelated, as the board would not boot if the Y-endstop was pressed (ie. if the bed was homed). The only help I found was from Lincomatic’s blog again but this time in a comment from “RustyPaint”, found here.

The issue is that the pin used by the Y-endstop is connected to the SS pin of the processor. So if the Y-endstop is closed it interrupts the SPI bus which the processor uses to talk to the SD card. The conflict also causes the board not to boot if the Y-endstop if pressed.

So the work around is that you disconnect the Y-endstop from the PrintrBoard and plug it in to the free Emergency endstop pins. You must then also configure the firmware to look at the E-stop pins instead of the Y-stop.

In pins.h, within the Marlin firmware, change line 918 from:

#define Y_MIN_PIN 20


#define Y_MIN_PIN 37

This solved the booting problem and now I can print from an SD card.

(Update: Just make sure your file name is a maximum of 8 characters long and the extension is a maximum of 3 characters. For example “Myprint1.g”)

Thanks to Nicolas Vicuña for pushing me to find a fix and help testing it.

NB: This post gets a fair bit of traffic.  If this information helped you at all then please leave a comment.

Tagged , , , , , , , ,

Arduino – PrintrBoard

I had some issues getting my PrintrBoard talking to the Arduino IDE but after digging the depths of the internet I found a few trick to making this work.

Credit for this post goes to Lincomatic. I’m posting my methods and what I did to get my board working. I also think having this information available it good for everyone. So…

I’m working on OSX 10.7.4 with a PrintrBoard Rev. D and here are the files I’m using:

Arduino v1.0.1 – Link

Teensyduino v1.09 – Link

Teensy boards update, courtesy of Lincomatic, modded by me – Link

Marlin Firmware for PrintrBoard, courtesy of Lincomatic – Link

Here are the steps I went through:

  1. Install Arduino IDE.
  2. Install Teensyduino.
  3. Right click on the Arduino application, click “Show package contents”
  4. Navigate to “/Contents/Resources/Java/hardware/teensy/” and place the Teensy boards update files here.  Overwrite any files if you’re asked.  This installs the correct information to connecting to your new Bootloader.
  5. Run Arduino, load the Marlin.PDE file, select “[BootloaderCDC]Teensylu/Printrboard” in the Tools – Board menu.
  6. Click Verify and make sure Marlin compiles correctly.
  7. Load the Arduino IDE, open the Marlin.PDE, select “[BootloaderCDC]/Teensylu/Printrboard” from Tools – Board menu, select the “dev.tty.usbmodem.1d11” (or similar numbers) serial port from Tools – Serial Port menu, click Upload.
  8. If successful, close the Arduino IDE, remove the boot pin jumper, press the reset button, load Pronterface (or whatever printing software you wish to use), select the “dev.tty.usbmodem.12341” serial port (note the different numbers from the bootloader mode) click “Connect” and you should be connected to your PrintrBoard.


Tagged , , , , ,

CDC Bootloader – PrintrBoard

I’d just like to add before I start that messing with the fuses and bootloaders may result in bricking your board, just don’t blame me if it goes wrong!

Credit for this post goes to Lincomatic.  I’m posting my methods and what I did to get my board working.  I also think having this information available it good for everyone. So…

I’m working on OSX 10.7.4 with a PrintrBoard Rev. D and here are the files I’m using :

CDC Bootloader, courtesy of Lincomatic – Link

AVRdude, “how-to install” link

Here are the steps I went through:

      1. Install AVRdude
      2. I bought and built the USBtinyISP kit from
      3. Connect the 6 pin socket on the USBtinyISP to the 6 pin header on the PrintrBoard so the RED wire on the ribbon cable is closest to the SD card socket.
      4. Add a jumper to the boot pins of the PrintrBoard, power it up, then press the reset button.  (For Rev. A, B & C PrintrBoards you remove the boot jumper)
      5. To set up the required space to upload the bootloader and free up some extra pins on the PrintrBoard set the “fuses“.  To do this paste and run the following code into Terminal:

avrdude -c usbtiny -p at90usb1286 -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf0:m

      1. Then upload the CDC Bootloader, (make sure the path for the hex file is correct*).

avrdude -c usbtiny -p at90usb1286 -U flash:w:BootloaderCDC.hex:i

(note AVRdude will give a verification error, ignore it as the programmer can program but can’t read back large files)

      1. At this point you should power down the PrintrBoard and remove the 6 pin cable.  You’re now ready to upload your firmware.

See the next post for how to configure your computer to upload the Marlin firmware to your PrintrBoard.

*the easiest way to get the right location of the bootloader.hex file is to type the first part “avrdude -c usbtiny -p at90usb1286 -U flash:w:” then drag the file into the terminal window over the text.  This fills in the location for the file, then don’t forget to type “:i” at the end of the line.

Tagged , , , , , ,