Showing posts with label Panelolu2. Show all posts
Showing posts with label Panelolu2. Show all posts

Friday, 25 April 2014

Using OpenSCAD to design a basic LCD enclosure

Regular readers will be aware I am a big fan of using scripted CAD, specifically OpenSCAD, as a design tool. I have gone into my reasoning before, which I won't repeat now. This is a further worked example showing the steps I took to design a case for a basic LCD+Click encoder controller for a 3d printer. This posts will try not to repeat too much ground covered in my previous OpenSCAD "How To": the OpenSCAD manual will help following along.

As always this is Open Source Hardware so the OpenSCAD source and supporting control knob file is shared on GitHub.


The electronics to encase


The PanelOne is a simple back board for a 20x4 character LCD with a encoder, a SD card board and brightness and contrast pots. I will go into the rationale and design of it in another post.



The aim for the case is to be quick and easy to print and use the the minimum of additional screws and other fixings.

Step 1 - Measurements


First step is to take measurements of the dimensions of the electronics - these can be taken from the CAD files if you have them:


This shows using the dimension function in KiCAD, although you can read the co-ordinates directly. The other, and my preferred, option is to take direct measurements:


This allows for the effect of the assembly processes to be taken into account easily.

Step 2 - Model the Electronics


Depending on how complex a case you are making, this step can be very simple or very complex. For a great example of how complex a circuit model model can be, check out UrielGuy's model of the Sanguinololu electronics




In this case I am going to keep it simple.

Start by assigning the measurements to variables - you will thank yourself many times over as you come to reuse or modify these.:

clearance=0.8;
wall_width=1.6; //minimum wall width //should be a multiple of your extruded dia
layer_height=0.2;

//LCD screen
lcd_scrn_x=99;
lcd_scrn_y=40.5;
lcd_scrn_z=9.4;

lcd_board_x=99;
lcd_board_y=61;
lcd_board_z=1.6; //does not include metal tabs on base

lcd_hole_d=3.4;
lcd_hole_offset=(lcd_hole_d/2)+1;

//board edge to center of first connector hole
lcd_connect_x=10.2;
lcd_connect_y=58.4;

//PanelOne circuit board
pl_x=136;
pl_y=lcd_board_y;
pl_z=4; //excluding click Encoder and SD card and cable headers, but including the soldered bottoms of the through hole connectors
pl_mounting_hole_dia=3.4;
pl_mounting_hole_x=133.6;
pl_mounting_hole1_y=3.4; //only bothering with 2 holes at this point
pl_mounting_hole2_y=58.4;

//rotary encoder
click_encoder_x=13.2;
click_encoder_y=12.6;
click_encoder_z=6;
click_encoder_shaft_dia=6.9+clearance;
click_encoder_shaft_h=12.2;
click_encoder_knob_dia=24;
click_encoder_offset_x=112.2;
click_encoder_offset_y=30.8;


//contrast and brightness holes
cb_dia=4; //hole diameter for adjustment screw
cb_h=15;
con_offset_x=107.2;
con_offset_y=16.1;
con_offset_z=pl_z;
bri_offset_x=117.1;
bri_offset_y=16.0;
bri_offset_z=con_offset_z;

//headers
//lcd connection header
lcd_h_x=(16*2.54)+2.54;
lcd_h_y=2.54;
lcd_h_z=3; //this is the gap between the circuit board caused by the plastic spaces on 2.54mm headers
lcd_h_offset_x=lcd_connect_x;
lcd_h_offset_y=lcd_connect_y;
lcd_h_offset_z=pl_z;

//IDC headers, use the clearance required for the plug
//these are much bigger on z than the actual headers for clearance
idc_h_x=16; //not all will be within case
idc_h_y=14+clearance;
idc_h_z=pl_z+click_encoder_z;
idc1_offset_x=128.4;
idc1_offset_y=20.5-clearance/2;
idc1_offset_z=-wall_width;
idc2_offset_x=idc1_offset_x;
idc2_offset_y=39.6-clearance/2;
idc2_offset_z=idc1_offset_z;

//SD card slot
SD_slot_x=24.5+clearance; //wider for clearance
SD_slot_y=29.5;
SD_slot_z=4;
SD_slot_offset_x=100.5-clearance/2;
SD_slot_offset_y=39.5;
SD_slot_offset_z=pl_z;

//case variables
shell_split_z = pl_z+SD_slot_z; //board split in the top of the slots
shell_width=wall_width+clearance;

shell_top = pl_z+click_encoder_z+2;

Then I write a number of small functions to draw up the components:

module LCD_assembly() {
    translate([0,0,lcd_h_offset_z+lcd_h_z])
        lcd();
        pl_board();
   //lcd connection header
    color("black")
        translate([lcd_h_offset_x,lcd_h_offset_y,lcd_h_offset_z])
            cube([lcd_h_x,lcd_h_y,lcd_h_z]);
}

//LCD screen
module lcd() {
    difference(){
        union(){
            color("OliveDrab")
                translate([0,0,0])
                    cube([lcd_board_x,lcd_board_y,lcd_board_z]);
            color("DarkSlateGray")
                translate([(lcd_board_x-lcd_scrn_x)/2,(lcd_board_y-lcd_scrn_y)/2,lcd_board_z])
                    cube([lcd_scrn_x,lcd_scrn_y,lcd_scrn_z]);
        }
        for(i=[lcd_hole_offset,lcd_board_x-lcd_hole_offset]){
            for(j=[lcd_hole_offset,lcd_board_y-lcd_hole_offset]){
                translate([i,j,lcd_board_z])
                    cylinder(r=lcd_hole_d/2,h=lcd_board_z+3,$fn=12,center=true);
            }
        }
    }
}

//PanelOne circuit board simplified
module pl_board() {
    difference(){
        union(){
            color("lightgreen")cube([pl_x,pl_y,pl_z]);
            //click encoder
            color("darkgrey"){
                translate([click_encoder_offset_x,click_encoder_offset_y,pl_z+(click_encoder_z)/2])
                    cube([click_encoder_x,click_encoder_y,click_encoder_z],center=true);
                translate([click_encoder_offset_x,click_encoder_offset_y,pl_z+click_encoder_z+(click_encoder_shaft_h)/2])
                    cylinder(r=click_encoder_shaft_dia/2,h=click_encoder_shaft_h,center=true);
            //contrast and brightness pots
                  translate([con_offset_x,con_offset_y,con_offset_z+cb_h/2])
                    cylinder(r=cb_dia/2,h=cb_h,center=true);
                  translate([bri_offset_x,bri_offset_y,bri_offset_z+cb_h/2])
                    cylinder(r=cb_dia/2,h=cb_h,center=true);
            }        
        }
        translate([-0.1,-0.1,-0.1]){
            cube([93,45,pl_z+2]);
            cube([6,lcd_board_y+1,pl_z+2]);
        }
        //mounting holes
        translate([pl_mounting_hole_x,pl_mounting_hole1_y,(pl_z+3)/2])
            cylinder(r=pl_mounting_hole_dia/2,h=pl_z+3,center=true);
        translate([pl_mounting_hole_x,pl_mounting_hole2_y,(pl_z+3)/2])
            cylinder(r=pl_mounting_hole_dia/2,h=pl_z+3,center=true);
    }
    //SD board 
    color("lightblue")    
        translate([SD_slot_offset_x,SD_slot_offset_y,SD_slot_offset_z]) 
            cube([SD_slot_x,SD_slot_y,SD_slot_z]);
   //IDC headers
    color("darkgrey"){
        translate([idc1_offset_x,idc1_offset_y,idc1_offset_z])
            cube([idc_h_x,idc_h_y,idc_h_z]);
        translate([idc2_offset_x,idc2_offset_y,idc2_offset_z])
            cube([idc_h_x,idc_h_y,idc_h_z]);
    }
}



It is a good idea to split down the design into logical blocks - these can be reused. The LCD module is re-used from the Panelolu2 case design for example.

I used the color function within OpenSCAD to make this render easier to view:

Step 3 - The Case


The case will be a simple design with back and front halves, along with a knob for the click encoder. It will be held together with M3 screws. A mounting method will be discussed in a later post.

The back and front halves are very simple to code, since the hard work has already been done in defining the electronics which is used to "cut" the holes required in the case.

module case_screw_holes(nut_trap=false,z_height=0, dia=lcd_hole_d) {
for(i=[lcd_hole_offset,pl_mounting_hole_x])
for(j=[lcd_hole_offset,pl_mounting_hole2_y]){
if (nut_trap) {
translate([i,j,z_height])
cylinder(r=dia/2, h=shell_width*2, $fn=fn);
translate([i,j,z_height])
cylinder(r=m3_nut_diameter_bigger/2+layer_height*2, h=shell_width, $fn=6);
} else {
translate([i,j,z_height])
cylinder(r=dia/2,h=shell_width*2+30,$fn=12,center=true);
}
}


}

module back() {
    difference(){
        translate([-shell_width,-shell_width,-shell_width])
            cube([pl_x+shell_width*2,pl_y+shell_width*2,shell_split_z+shell_width]);
        translate([-clearance,-clearance,-clearance])
            cube([pl_x+clearance*2,pl_y+clearance*2,shell_split_z+clearance+0.01]);
        LCD_assembly();
        case_screw_holes(false,-shell_width);
    }
    //support pillar
    translate([6,6,0])
        difference(){
            cube([10,10,pl_z+lcd_h_z]);
            translate([wall_width,wall_width,0])
            cube([10-wall_width*2,10-wall_width*2,pl_z+lcd_h_z+0.1]);
        }
    
}



module front() {
    difference(){
        translate([-shell_width,-shell_width,shell_split_z])
            cube([pl_w+shell_width*2,pl_y+shell_width*2,shell_top-shell_split_z+shell_width]);
        translate([-clearance,-clearance,shell_split_z-0.01])
            cube([pl_w+clearance*2,pl_y+clearance*2,shell_top-shell_split_z+clearance]);
        LCD_assembly();
        case_screw_holes(false,shell_top+shell_width);
    }
}


The difference() function used in the code above subtracts a cube that is "shell_width" - "clearance" from the overall front or back shell. It then subtracts the LCD_assembly and the case holes.  The following two pictures (with elements made transparent/hidden) helps to illustrate the process.




Step 4 - Tweak


The great thing with rapid prototyping is the ability to quickly test out designs and make improvements. The first rough print had a couple of issues:


support for the LCD needed

clearance for the IDC connectors needs moving up

Overall the following issues were noted:

  • The holes for the IDC plugs for the cables need to be wider and higher up in the case, easiest to replace with a single cutout.
  • The box spacer used as a support in the back interfered with the back of the LCD
  • To hold the board more rigidly some supports are required - the corners are the easiest place for these.

Fixes:


Change the IDC header dimensions, only one "header" needed in the model now:

//IDC headers, use the clearance required for the plug
//these are much bigger on z than the actual headers for clearance
idc_y_x=16; //not all will be within case
idc_y_y=37.9;
idc_y_z=6.39+2.5;
idc1_offset_x=128.4;
idc1_offset_y=18.1;

idc1_offset_z=1.61;



Remove the box spacer and add supports to the front and back:

module back() {
    side=8; //for the supports
    difference(){
        union(){
            difference(){
                translate([-shell_width,-shell_width,-shell_width])
                    cube([pl_x+shell_width*2,pl_y+shell_width*2,shell_split_z+shell_width]);
                translate([-clearance,-clearance,-clearance])
                    cube([pl_x+clearance*2,pl_y+clearance*2,shell_split_z+clearance+0.01]);
                LCD_assembly();
            }
            //corner supports
            for(i=[-wall_width,pl_y-side+wall_width]){
                translate([-wall_width,i,-shell_width])
                    cube([side,side,8.75]);
                translate([pl_x-side+wall_width,i,-shell_width])
                    cube([side,side,4.35]);
            }
            //additional support
            translate([lcd_board_x-side,-wall_width,-shell_width])
                cube([side,side/2,8.75]);
        }
        case_screw_holes(false,0);
    }
}

  

module front() {
    side=8; //for the supports
    difference(){
        union(){
            difference(){
                translate([-shell_width,-shell_width,shell_split_z])
                    cube([pl_x+shell_width*2,pl_y+shell_width*2,shell_top-shell_split_z +shell_width]);
                translate([-clearance,-clearance,shell_split_z-0.01])
                    cube([pl_x+clearance*2,pl_y+clearance*2,shell_top-shell_split_z +clearance]);
                LCD_assembly();
            }
            //corner supports
            for(i=[-wall_width,pl_x-side+wall_width])
                for(j=[-wall_width,pl_y-side+wall_width]){
                    translate([i,j,shell_split_z])
                        cube([side,side,shell_top-shell_split_z+wall_width]);
                }
            //additional supports
            for(i=[-wall_width,pl_y-side/2+wall_width]){
                translate([lcd_board_x-side,i,shell_split_z])
                cube([side,side/2,shell_top-shell_split_z+wall_width]);
            }
        }
        case_screw_holes(false,shell_top+shell_width);
    }
}


The final case:


Step 5 - Optional Extras


For models I use often or that go through many iterations where I want to quickly change between different parts it makes sense to simplify the selection of what part of the model to display. At the top of the scad file I have:

///////////////////////////////////////////////////////////
//front, back or Assembly
///////////////////////////////////////////////////////////
side=2; //1 = front, -1 = back 2=printing layout -2 Electronics module 0=assembly model
///////////////////////////////////////////////////////////

This then determines what is rendered using a list of if statements used because, annoyingly, OpenSCAD does not appear to support a "switch" statement.

///////////////////////////////////////////////////////////////////////////////////////
// front
if (side==1)
{
    front();
}
// back
else if(side==-1)
{
    back();
}
//Printing plate
else if(side==2)
{
    translate([shell_width,pl_y*2+shell_width*4,shell_top+shell_width])
        rotate([180,0,0])
            front();
    translate([shell_width,shell_width,shell_width])
        back();
    translate([pl_y*0.5,pl_y*1.5+shell_width*2,shell_width])
    knob_assembly(click_encoder_knob_dia/2);
}
//Electronics
else if(side==-2)
{
    LCD_assembly();
}
//assembly
else
{
    back();
    front();
    LCD_assembly();
 translate([click_encoder_offset_x,click_encoder_offset_y,wall_width+ click_encoder_shaft_y+click_encoder_z-2])
        knob_assembly(click_encoder_knob_dia/2);
}
///////////////////////////////////////////////////////////////////////////////////////

Thus changing one number allows you pick the render you want:




That's all for now - I hope to get a blog post out about the PanelOne itself soon.

Tuesday, 24 September 2013

Mendel90 Laser Cut - Ready to Print

The Think3dPrint3d Lasercut Mendel90 is ready! After a period of extensive prototyping and beta testing the design is set, and right now multiple versions of this printer are churning out the parts for the initial run of kits.

This is our interpretation of the Mendel90 design by Nophead based around a laser cut frame. It borrows the fixing method from the Lasercut i3 design by Shane Graber and the majority of plastic parts are from the Dibond Mendel90.




A quick orientation around the printer:-

First, the laser cut frame is made from melamine-coated MDF which is much more resistant to knocks then regular MDF and doesn't require any painting or other finishing.



It is very quick to assemble with square nuts and M3 socket cap screws


The build area is 200x200x200mm 


All the wiring comes ready to plug and play in pre-assembled cables or looms so there is no crimping or soldering required at all. The printer comes with a RAMPS controller with 5 "Ice Blue" Stepsticks and the Panelolu 2 controller as standard.



The acrylic enclosure is an optional extra which keeps the heat inside the printer to reduce warp when printing with ABS. It also helps to reduce noise and adds to the professional look of the printer. It uses the same fixing method as the printer frame and can be fixed on quickly and simply without disturbing the printer or calibration.



Overall, the design removes hassle from kit assembly at every turn. The printer can be easily put together in a day, with very little calibration required as all the critical dimensions are set by the laser cut frame. 




Kits will be available shortly (Update: now available from our webstore). We have a couple of components to finish sourcing in bulk and I will do another blog post with a run-down of the assembly process. I also need to tidy up and document the source code for the plastic parts and frame. All the source will be available on our Github before the printer goes on sale.

We are supporting the RepRap stand at the TCT show this year and will have a Mendel90 LC or two on display. The TCT show is free to register for so please do come round and say hello.

Thursday, 16 May 2013

Basic Marlin Configuration.h modification

In order to set up Marlin firmware to work with your 3D printer the Configuration.h file needs to be modified to match your hardware. This post will describe the basics of modifying Configuration.h.

The version of Marlin this is based on is the current (as at 15/05/13) Marlin_v1 version, modified slightly to incorporate the Think3dPrint3d Panelolu2. There are various different Marlin versions:

EricZalm master version
Think3DPrint3D version
RepRapPro version
Nophead version

This post is aimed at helping users of RepRapPro Marlin and Nophead's Marlin migrate their configurations to T3P3 Marlin in order to use the Panelolu2; however it may be helpful to others who are setting up their configuration.h for the first time.

Refer to the working/default Configuration.h from your current setup if you have one and use that as a guide to what settings to put at each stage - if in doubt use the default setting from your printer manufacturer as a start point.

Note: I do not cover every setting, just the main ones to get up and printing.

Environment

The T3P3 version of Marlin is only tested on Arduino-0023 and on the following electronics boards:

Sanguinololu 1.2, and 1.3a
Melzi
RAMPS 1.3 and 1.4
Printrboard

First open Configuration.h in your favourite text editor or the Arduino IDE (it is located in <Marlin Folder>\Marlin\Configuration.h)


(from this point on I am not going to use screen shots for each Configuration.h line)

I will refer to the line number in the version of the T3P3 firmware available today. This will change over time and get out of date but it will be a good start and it should be fairly obvious which line I am referring to. You can see the line number on the bottom left of the Arduino IDE screen - in the shot above the cursor is on line 12.

Add an Author/Version


Line 12
#define STRING_CONFIG_H_AUTHOR "(<something useful here>)" //Who made the changes.

This is helpful to confirm with a glance which version of your configuration.h is loaded on your hardware:



Baudrate


Line 20
// This determines the communication speed of the printer
#define BAUDRATE 250000
//#define BAUDRATE 115200


Keep this on the faster setting unless you have a need to use a slower setting. Make sure you select the same baudrate in Pronterface (or your control software) as you have set here when you connect.

Motherboard


Line 51
#define MOTHERBOARD 7

As the comment above this line shows there are many supported electronics motherboards. Make sure you chose the right version for your electronics (for example 63 for Melzi, 33 for RAMPS 1.3/1.4 with 1 extruder, 34 for RAMPS 1.3/1.4 with 2 extruders etc).

Temperature Measurement


Line 90
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_BED 1

Most printers will use a thermistor, and a common choice is the "EPCOS B57560G104F". The standard table number "1" works fine for this thermistor. I have copied two tables from Nophead's version of Marlin into the T3P3 version - numbers 11 and 12. If you have a Mendel90 kit from Nophead then these will probably be the best choice for you (although they were numbered 8 and 9 in Nophead's version, I had to change the numbering as 8 and 9 were already taken in the master version).

If you have a RepRapPro printer, their custom version of Marlin does not use a pre-calculated thermistor lookup table but computes the values directly. I have incorporated this into the latest T3P3 version on Marlin as described in my previous blog postMy copy is rather untested so use with caution. Even though on-the-fly calculation is now available, I recommend using tables. Nophead's blog describes the theory behind the table calculations and the "createTemperatureLookupMarlin.py" script in the Marlin folder allows for the calculation of an accurate table for your thermistor and temperature range of interest.

If you want to use the calculated thermistor values then:

Line 97
//use RepRapPro Algebraic Temperature calculation rather than
//the tables - still experimental in this version of Marlin.
#define ALGEBRA_TEMP 

Line 104 onwards
Choose the serial resistor for your electronics (4700 is standard)

#define SERIAL_R 4700
//#define SERIAL_R 10000

Choose your thermistor Beta values (from the data sheet, ask your supplier) and value at 25C (100K thermistor is 100000, 10K is 10000)

// EPCOS B57560G104F (the standard 100K one)
#define E_BETA 4036.0
#define E_NTC 100000.0
#define BED_BETA 4036.0
#define BED_NTC 100000.0

Other standard thermistor types that RepRapPro uses are already in configuration.h, commented out. If you change to these types then comment out the lines referring to the EPCOS and uncomment the lines for the thermistor values that match yours. For example to use the latest RepRapPro thermistor values comment out:


// EPCOS B57560G104F (the standard 100K one)
//#define E_BETA 4036.0
//#define E_NTC 100000.0
//#define BED_BETA 4036.0
//#define BED_NTC 100000.0

and uncomment

// RS 198-961
#define E_BETA 3960.0
#define E_NTC 100000.0
// Rapid 61-0446 ; Semitec 103GT-2 All RepRapPRo Mendels and Thermistors shipped after 1/4/13
#define BED_BETA 4126.0
#define BED_NTC 10000.0

Temperature at Print Start

Line 137
#define TEMP_RESIDENCY_TIME 10 // (seconds)
#define TEMP_HYSTERESIS 3       // (degC) range of +/- temperatures considered "close" to the target one
#define TEMP_WINDOW     1 // (degC) Window around target to start the residency timer x degC early.

These allow you to control how close to the exact set temperature the thermistor reading needs to be to begin extruding. The defaults work OK, however to get a quicker start, I change my TEMP_RESIDENCY_TIME to "5" and TEMP_WINDOW to "2".

Max and Min Temperatures


The printer will give an error if the temperatures are outside of these values. I find that in a cold garage in winter the MIN_TEMPs need to be "1" rather than "5". Don't comment out or set to 0 or else the hotend could overheat if the thermistor is disconnected or breaks.

Line 144-155
#define HEATER_0_MINTEMP 1
....
#define HEATER_0_MAXTEMP 275
....

PID Temperature control


In order to get more stable extruder temperature control the use of PID control is recommended. To enable it ensure PIDTEMP is uncommented.

Line 164
#define PIDTEMP

You need to set the PID constants specific to your hotend. See Wikipedia theory on PID control if interested (not required to make this work):-

Line 178 onwards
    #define  DEFAULT_Kp 22.2
    #define  DEFAULT_Ki 1.08  
    #define  DEFAULT_Kd 114 

By far the easiest way to calculate these is to use PID autotune once your firmware is uploaded to your printer. This function experiments with the reaction of your hotend and calculates the best PID values. For more detail of PID autotune check this wiki entry. Once you have the values you can save them to EEPROM (see the section later in this guide about enabling EEPROM) or you can replace the values in the firmware (at line 178 as shown above) and re-upload your firmware.

You can use PID on the heated bed in a similar manner but I don't find it necessary. To do so uncomment PID_TEMP_BED:

Line 203
#define PIDTEMPBED

and define the constants for your bed. It is best to use PID autotune for this as well, choosing a different target temperature, as suggested in the Marlin comment:

"FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles."

Line 216
    #define  DEFAULT_bedKp 10.00
    #define  DEFAULT_bedKi .023
    #define  DEFAULT_bedKd 305.4

Extruder protection

The following lines prevent extrusion when conditions are not right.

Line 233
#define PREVENT_DANGEROUS_EXTRUDE
#define PREVENT_LENGTHY_EXTRUDE

Only comment them out to override the effect they have if you have a specific reason for doing so.


Endstops

For Sanguinololu, RAMPS, Melzi and most other common electronics all the endstop pullups should be on - ensure line 248 is uncommented:

Line 248
#define ENDSTOPPULLUPS

Generally you want the endstops to trigger when open: this is controlled with the following lines:

Line 270
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. 

For more information on endstops and why it is generally better to have Normally Closed Endstops have a look at this part of the Reprap wiki and the linked forum post.

Axis direction is controlled by the motor wiring and by these lines:

Line 287
#define INVERT_X_DIR false    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true

Many printers only have 3 endstops, one per axis, so you have to tell the firmware which end to home towards:

Line 296
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

This combined with the length of the axis sets the dimensions of the printer. It is worth using software endstops to keep the print head within the print area during normal operation:

These need to be set to the correct values for your printer or else you can command the printer to move outside of the area it can cover and potentially cause damage.

Line 300
#define min_software_endstops true //If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
// Travel limits after homing
#define X_MAX_POS 205
#define X_MIN_POS 0
#define Y_MAX_POS 205
#define Y_MIN_POS 0
#define Z_MAX_POS 200
#define Z_MIN_POS 0

I find that it is safest with a new printer to set the MAX_POS values to less than the maximum theoretical sizes, then physically check how much more travel is possible and adjust the values upwards if appropriate.

Movement Settings

These settings define how fast your printer's axis move and set the accuracy of moves. In most cases there will be a direct copy from the configuration.h file of your printer supplier. First is the speed the axes move during homing; this is in mm/s and the format X,Y,Z,E. E is 0 because the extruder is not homed.

Line 325
#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)


The next line defines how many steps of the stepper motor are required to move an axis by 1mm. Getting this wrong means the printer axis will not move the right distance. You MUST change the settings from the defaults (unless you actually have an Ultimaker!). Once again the format is  X, Y, Z, E. Prusa's calculator is very helpful for calculating the appropriate X, Y and Z values for your stepper motors, belt pitch and pulley teeth. For E, because hobbed bolts all vary slightly, the only way to get the correct value is to start with a reasonable value (e.g. 700 for a Wade's) and calibrate your extruder: RichRap's Slic3r blog provides detailed instructions for doing this.

Line 329
#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for ultimaker


The following lines set the speed and acceleration of your printer. Often the quality of prints can be improved by using slower acceleration values and smaller XYJERK values. They definitely need setting down for less-rigid machines with threaded-rod frames. Check the default values in the Marlin as supplied with your machine and use these to start with.

Line 330 Onwards
#define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
#define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.

#define DEFAULT_ACCELERATION          3000    // 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

// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK                20.0    // (mm/sec)
#define DEFAULT_ZJERK                 0.4     // (mm/sec)
#define DEFAULT_EJERK                 5.0    // (mm/sec)

EEPROM - Saving Settings without recompiling firmware

When EEPROM is enabled there are three locations where versions of the printer settings are stored.
  1. Hard-coded in Firmware in Configuration.h.
  2. In the running RAM of the microcontroller - not saved on power down or reset.
  3. In EEPROM
If EEPROM is enabled the settings are loaded from EEPROM, not from the hard-coded values in Configuration.h. EEPROM settings can be updated using a series of "M" commands. See the G-Code page on the RepRap wiki for a description of all the G and M codes including those for saving and reading from EEPROM.

I recommend enabling EEPROM_SETTINGS and EEPROM_CHITCHAT
Line 356

//define this to enable eeprom support
#define EEPROM_SETTINGS
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can.
#define EEPROM_CHITCHAT

Display Screens - Panelolu2

There are an increasing number of LCD screens supported by Marlin, but this post only covers the Panelolu2. To enable the Panelolu2 uncomment the following line:

Line 381

#define PANELOLU2

If you don't like the buzzer making a beep sound then comment out the PAN_BEEP

Line 386
 #define PAN_BEEP //comment out to disable buzzer

I recommend that you get your printer working without enabling the Panelolu2 first and then uncomment the #define PANELOLU2 line afterwards. Note that Marlin will hang if the PANELOLU2 is enabled but not connected.

Thats it!

Please feel free to leave useful links to further information in the comments to this blog post.