Loading

Marlin firmware for the Ultimaker

From Ultimaker Wiki
(Redirected from Marlin)
Jump to: navigation, search
Important
Make sure you read the section about steps-per-unit setting below!   


NOTE: THIS IS EXPERIMENTAL!

Marlin is yet another step in reprap / ultimaker firmware, based on Sprinter and grbl.

Some of its features:

  • Arduino based
  • High speed IO pin access (not using the slow arduino functions)
  • Acceleration
  • Look ahead (prevent unwanted slow down)
  • Efficient interrupt handler
  • Buffering


Contents

Downloading

Get it from ErikZalm's GIT respository: [[1]] Or build a version using Daid's builder tool: [[2]] (No need to compile yourself, so you can skip the next section)

Compiling

  • Load up the latest Arduino (version 0022 is known to work)
  • Open the Marlin.pde file from the /Marlin folder.
  • Select COM port (tools --> Serial port menu)
  • From the tools --> boards menu, select Arduino Mega 2560 (that's the board the UM uses)
  • Compile
  • Press upload

Configuring

There are many parameters in Marlin that can be configured using various M-codes. The default settings are conservative and should work for most configurations. The only parameter that you'll need to check for sure is the steps per unit mm for the extruder, see below.

  • M92 - set steps per unit mm. see below.
    • default: {X79.87220447 Y79.87220447 Z200*8/3 E14}
  • M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
    • default: {X9000 Y9000 Z150 E10000}
  • M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
    • default: {X160, Y160, Z10, E500000}
  • M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2
    • default: {S4600 T7000}
  • M205 - advanced settings:
    • S=minimum travel speed while printing, default=0
    • T=minimum travel speed while traveling, default=0
    • B=minimum segment time to prevent buffer underruns, default=20000
    • X= maximum xy jerk,default=30
    • Z=maximum Z jerk, default=10
  • M301 - Set PID parameters P I and D
    • Will be enabled in future release
  • M500 - stores above parameters in EEPROM
  • M501 - reads above parameters from EEPROM
    • (if you need reset them after you changed them temporarily).
  • M502 - reverts to the default "factory settings".
    • You still need to store them in EEPROM afterwards if you want to.

Steps per unit

This tells the firmware how many steps are required to move in x,y,z, and how many steps are required to extrude material. It is one of the most crucial parameters and one you must pay attention to, as the default settings may not be correct for your machine.

For X,Y,Z axis, the default values are usually correct. For the extruder, the steps per unit mm depends on 2 things:

  • the mechanical set-up of your ultimaker: (such as the diameter of your filament drive gear)
  • the software:
    • Skeinforge versions below 40 (?) and Netfabb: the steps per unit are defined as steps per unit of extruded material.
    • Skeinforge versions 40(?) and higher: steps per unit of raw material.

Below is a matrix of values for various configurations:

Skeinforge below 40 or NetFabb Skeinforge higher then 40
Old bolt E14 E926.5
New bolt E14 E865.888

Steps per unit can be set using the M92 command:

e.g. M92 E14

you can include this in your start.gcode when using skeinforge, or you can run a one-time gcode script that issues this command, followed by a M500 to store it in EEPROM.

Buffer underruns

The high printing speeds of Marlin can cause buffer underruns, which means that the computer cannot send data to the printer fast enough, and the printer occasionally comes to a stop, waiting for data from the computer. You'll experience this when printing parts with high polygon count and many small segments; the printer slows down and does not move as smooth as it did before.

There multiple ways to circumvent this:

  • print from SD; communication with the SD is much faster than with the PC
  • reduce the polygon count or resolution of your original STL file.

marlin has a feature that reduces speed gradually to prevent buffer underruns. The parameter that sets how fast it should slow down can be varied using the M205 Bxxx command.

Increasing speed & performance

The default configurations are conservative so they will work without troubles for most people. If you want to push the limits of your machine, you can play with the parameters. Below are some guidelines:


  • Increase maximum speed
    • e.g M203 X500 Y500 will give you higher speeds.
  • Increase acceleration
    • If you have non-stock motors or another solution that gives more torque, you could increase the default acceleration.
    • You may also want to increase the x,y jerk. Increasing it will give you higher speeds at risk of lost steps. e.g M205 X50
  • Increase minimum speed
    • Some skeinforge-generated code does not travel at high speeds. If you see a lot of stringing and

too low speeds while traveling, you can increase the minimum travel speed.

    • eg. M205 T500 will cause all travel moves to be done at 500mm/s, regardless of the skeinforge settings.
  • Buffer underruns
    • If you have troubles with high-density polygon printing, try increasing or decreasing the minimum buffer time.
    • eg. M205 B50000 or M205 B0 to disable it completely

Print Results

  • My first print ...

Performance measurements

The procedure used is described here: SendG. 115200bps, Using 6 lines buffer (-c6)

50  mm/sec : factor= 1.05
100 mm/sec : factor= 1.80
200 mm/sec : factor= 4.10