Friday, February 28, 2014

Positioning the Z limit switch and Calibrating Heat Bed Height

Recap: I've built a Prusa Mendel 3-D printer from a kit I purchased from nwreprap.com.  I am performing some calibration steps before I attempt the first print.

One of the things we haven't done yet is determine the final position of the Z limit switch and adjust the height of the heat bed at each corner.

In order to complete this step, you must have downloaded the software, installed the Arduino drivers , uploaded the firmware and you must be able to operate Pronterface.  You'll also need a couple pieces of regular white paper - the kind that goes into a laser or inkjet printer and a good quality ruler.

Before you get started with the calibration, an initial check to ensure that your piece of glass is flat is advised.

Detecting a Warped Piece of Glass Before Installation

Lay the glass on a flat surface.  Tear off a piece of paper.  Lay the edge of the ruler on the glass.  Now try to wedge the piece of paper between the ruler and the glass at the edges of the glass and in the center.  If there is space between the ruler and the glass, then paper will fit between the ruler and the glass.  This means that either the glass or the edge of the ruler is warped.  Try using flipping the ruler and using the other edge of the ruler.  If the results are the same, then the glass is likely warped.  If the first test succeeds, turn the glass 90 degrees and repeat it in the other direction.

Test for warped glass by sliding a scrap of paper between the ruler and edge of glass

Test for warped glass by sliding a scrap of paper between the ruler and the center of the glass
So you're going to run 4 tests:

  • Direction A at the edges
  • Direction A in the center  
  • Direction B at the edges
  • Direction B in the center 
To be really sure, you should flip the glass over and trying these tests on the other side.

Mounting the Glass on The Heat Bed

Make sure that the glass has been attached to the heat bed using bulldog clips.  It's important that the heat bed maintain contact with the glass throughout the entire surface to ensure that the glass's temperature is even.

I initially used the 4 bulldog clips that came with my kit.  I was able to wedge a piece of paper between the heat bed and the glass, so I determined that the heat bed sagged in the middle a bit.  So I added 4 more bulldog clips.

Positioning the bulldog clips
Z Axis Limit Switch and Heat Bed Calibration

You need a piece of scrap paper for this step.

Recall that we installed the heat bed on springs.  The height of the heat bed can be adjusted by turning the locknuts at each corner of the heat bed.
One of the four corners of the heat bed with a locknut and spring on an M3 bolt.
The idea here is to adjust the position of the Z axis limit switch and the height of each corner of the glass so that the Z axis limit switch clicks when the distance between the hot end nozzle and the glass is approximately the same as the thickness of a piece of paper.

From my experience this takes some of trial and error.

In my experience, the best way to achieve this is the following:

1. Lower the heat bed by turning the locknuts clockwise to compress the springs until maybe 1/8 inch of each M3 bolt is exposed at the top.
2. Position the heat bed so that the hot end is as close as possible to one of the corners.
3. Set the Z axis limit switch to some height where you think it will activate when the hot end is lowered within 1/8" of the glass.  Tighten the two bolts on the Z axis limit switch.  This step requires trial and error.
Positioning the Z limit switch
4. Use Pronterface to lower the hot end until the Z axis limit switch is activated.
5. If the hot end is less than 1/8 inch above the heat bed, proceed to step 6, otherwise go back to step 3.
6. Slowly turn the locknut counterclockwise to raise the heat bed.  At regular intervals test the distance between the hot end and the glass by sliding a piece of paper between the hot end and the glass.  When the paper starts to "grab" then stop.
7. Repeat for the other 3 corners - this means complete steps 2 and 6 for the other corners.

Making Sure The Glass Is Still Flat Upon Completion

Once you've adjusted the 4 corners of the heat bed, you can perform another test to determine if your glass is still perfectly flat, even after having been mounted on the heat bed.  A flat piece of glass is necessary to ensure that your parts are printed consistently regardless of the placement on the glass.  You'll need a piece of scrap paper for this step.

1. Use Pronterface to raise the hot end a couple mm.
2. Move the hot end to the center of the glass using Pronterface.
3. Use Pronterface to lower the hot end until the Z axis limit switch activates
4. Try to insert a piece of scrap paper between the hot end and the glass.  If the glass is still perfectly flat, then the piece of paper should "grab" just a little between the hot end and the glass.

Test for warped glass by sliding a scrap of paper between the hot end and the center of the glass after calibrating the height of the corners of the glass.

Monday, February 24, 2014

Level The X Carriage

Recap: I've assembled a Prusa Mendel 3-D printer from a kit purchased from nwreprap.kit.  I'm going through a set of calibration steps before I attempt the first print.

The extruder rides left and right on the X carriage which in turn rides up and down on two Z Axis lead screws which are controlled by the two Z axis stepper motors.  The X carriage must be leveled to ensure that your prints are square.  You'll need your digital calipers to complete this step.

This step is pretty simple: manually rotate either of the Z lead screws until the distance from the left Z stepper motor to the X idler and the distance from the right Z stepper motor to the X motor mount is the same.


Leveling the X carriage.  Red lines indicate distances that must be the same.  Orange lines indicate direction of travel

Wednesday, February 19, 2014

Calibrating X, Y, Z and Extruder Axis Steps Per Unit

Recap: I've built a Prusa Mendel 3-d printer from a kit that I purchased at nwreprap.com.  Before I can print, I need to go through a series of calibration steps which are outlined here.

This post will explain how to calibrate the _AXIS_PER_STEP_UNIT constant in the Sprinter software's Configuration.h file that I briefly touched on in a previous post.  Completing the steps in this post requires you to have downloaded all of the software, installed the Arduino driver, uploaded the firmware and gotten familiar with using Pronterface.  You'll also need digital calipers and a ruler to make measurements.

Infact, all we're going to be doing for this step is changing some values in the Configuration.h file that lives inside the firmware and uploading it.

The _AXIS_PER_STEP_UNIT setting is an array of 4 values that tell the stepper motors how to translate a "unit" of movement in Prusa to a number of steps to be taken by the stepper motors.  I haven't seen a good description of how much a "unit" is.  Each of the 4 values goes with the corresponding axis: X, Y, Z and Extruder.

When I initially downloaded the Sprinter firmware, this is what the settings looked like:

#define _AXIS_STEP_PER_UNIT {80, 80, 3200/1.25,700}

To calibrate the X, Y and Z axes follow these steps to perform an "iteration" of the calibration process.  Note that more than one iteration per axis is usually necessary.  With each iteration, you'll instruct your Prusa to move a certain distance, measure the resulting distance and apply a correction factor to the values that you initially downloaded.

For each iteration, follow these steps:
  • Pick one or more axes to work on
  • Launch Pronterface and connect to your Prusa Mendel.
  • For the chosen axis, measure the offset from some fixed point and zero out the digital caliper
  • Use Pronterface to cause a 100 mm movement in your chosen direction
  • Measure the actual amount moved
  • Enter the correction factor in Configuration.h as follows: multiply the previous value by the desired movement and divide by the actual movement
  • Exit Pronterface
  • Launch Arduino software and upload the firmware
  • Repeat until the actual movement matches the desired movement very closely

So let's say you start by calibrating the X axis.

On the first iteration, you instruct the Prusa Mendel to move 100 mm and it actually moved 81 mm.  So now you have the following that should be uploaded in the firmware (note the numbers in bold have been added):

#define _AXIS_STEP_PER_UNIT {80 * 100 / 81, 80, 3200/1.25,700}

On the second iteration, you instruct the Prusa Mendel to move 100 mm and it actually moved 99 mm.  This is the effect (new numbers added in bold):

#define _AXIS_STEP_PER_UNIT {80 * 100 / 81 * 100 / 99, 80, 3200/1.25,700}

At this point, it's a good idea to simply multiply out 80 * 100 / 81 * 100 / 99 = 99.763... and put that value in the Configuration.h file instead of "80 * 100 / 81 * 100 / 99".

To calibrate the Extruder, I suggest the following which worked for me pretty well:
  • Insert filament into the extruder
  • Feed the filament so that about 50 mm is inside the extruder (if you feed the filament too far with the hot end off, it will have no place to go when it reaches the hot and the extruder will scrape a chunk of it off and the filament will jam in the extruder.  At that point you'll have to pull it out by hand)
  • Stick a piece of tape to mark the position of the filament just where it enters the extruder.  Alternatively, consider marking the position of the filament with a Sharpie.
  • Feed the filament in reverse by 10 mm using Pronterface
  • Stick another piece of tape to mark the position of the filament just where it enters the extruder.
  • Measure the distance that the tape moved with a ruler
  • Apply the effect of this iteration to the Extruder constant
Apply the first piece of tape

Feed the filament and apply the second piece of tape

Measure the distance between the two pieces of tape


For example, if you instructed the extruder to move 10 mm and it moved 10.5 mm, this is what you'd have:


#define _AXIS_STEP_PER_UNIT {80, 80, 3200/1.25,700 * 10 / 10.5}

In the end, my calibration yielded:

#define _AXIS_STEP_PER_UNIT {100, 100, 2561, 700 * 10 / 10.5}

If you're assembling a Prusa Mendel kit from nwreprap.com, I expect those values will work pretty well for you.  The first item to print is a 20 mm cube.  Once printed and measured, this cube will tell you how good your calibration is.

Sunday, February 16, 2014

Basic Control Checks for Prusa Mendel with Pronterface

Recap: I've built a Prusa Mendel 3-D printer from a kit that I purchased from nwreprap.com.  Assembly of the kit is complete.  I'm in the process of calibrating my printer.

Before you power up your Prusa Mendel for the basic control checks, I suggest you move the extruder to the center of the heat bed and make sure it's at least an inch above the heat bed.  This will allow it to move freely in any direction.

Once you've downloaded the software and uploaded the firmware,  it's a good idea to test to make sure that you've wired up your Prusa correctly.  At this point in time you should be able to exercise your printer's functions from your PC.  You can use a piece of software that you've downloaded called Pronterface.  Pronterface is a terrific tool for exercising the various devices on your Prusa, plus it will be used to upload your designs to the Prusa for printing.

Here is a list of items you can check:
  • X axis direction and limit switch.
  • Y axis direction and limit switch
  • Z axis direction for both motors, limit switch
  • Extruder direction
  • heat bed and heat bed thermistor
  • hot end resistor and hot end thermistor
Caution: it should go without saying that touching the hot end or the heat bed during these tests can result in burns because these parts may get activated when you're not expecting because of a wiring mistake.

Note: I found it helpful to have a heat probe available to troubleshoot the temperature functionality.  I use a Fluke 80BK-A probe along with a fluke 179 DVM.

With your Prusa Mendel powered up and connected to your PC, click on the Pronterface icon to get started:



Make sure that the Port is set appropriately for your configuration, set the port bit rate to 250000 bps and
 click "Connect"

Setting the port, bit rate and initiating the connection

Now you should see the text of the "Connect" button has changed to "Disconnect" and the controls change from grayed out to enabled:

Controls are enabled (printer is connected)

Controls are disabled (printer is disconnected)

The controls allow you to move any axis by 0.1, 1, 10 or 100 mm.  I suggest starting out with 1 mm moves for the testing you're about to do.  1 mm is enough to see with your eye, but not too much to cause damage if something goes wrong.

Control to move x axis 1 mm in the negative direction



Control to move y axis 1 mm in the negative direction

Control to move z axis 1 mm in the negative direction

For any given axis, the limit switch represents the minimum value.  This means that clicking on "-x" or "-y" or "-z" buttons should move the extruder closer to the limit switch.  So "-x" should move the extruder to the right, "-y" should move the heat bed toward you and "-z" should move the extruder downward, toward the heat bed.  If you're seeing the opposite, simply pull the connector for the relevant stepper motor, turn it 180 degrees and plug it back in.  During the assembly of my Prusa Mendel, I discovered that I had to do this for my X, Y and Z stepper motors.  Alternatively, there is a setting in the Configuration.h file of the firmware that can accomplish this.

To check a limit switch, simply use the Pronterface controls to move the extruder in the negative direction until it activates the limit switch.  You should hear a click as the limit switch activates.  Further movement in the negative direction should be suppressed.  At this point in time, the Z limit switch has not been precisely positioned/calibrated so you'll have to adjust the Z axis limit switch to some reasonable height where it can be activated.

Clicking on the "Extrude" button should turn the large wheel in a counter-clockwise direction when viewed from the front.

Extruder control
To test the hot end and the hot end thermistor, click on the "Set" button and look for the "Heater" temperature gauge to start rising.  If it doesn't start rising, there are at least two causes: (1) the hot end thermistor is not connected properly or (2) the hot end resistor is not connected.  If you see the "Bed" temperature gauge start rising, then you may have swapped the connections of the two thermistors.  Click the "Off" button hear the "Set" button to turn off the hot end.  Note that the hot end will remain hot for a long time after you turn it off.

"Set" button and Temperature gauge for hot end resistor.

Similarly, to the the heat bed, click the appropriate "Set" button and look for the "Bed" temperature gauge to start rising.  If you soldered the surface mount LEDs and resistor to your heat bed, you should see one of the LEDs light up now.  Click the "Off" button near the "Set" button to turn off the heat bed.  The heat bed will remain warm for some time after you turn it off.

"Set" button and Temperature gauge for heat bed

One thing to note is that I haven't figured out how to test the little fan that cools the extruder using Pronterface.

When finished, click the "Disconnect" button and exit Pronterface.
















Saturday, February 1, 2014

Uploading the Firmware Onto the Arduino Mega (Video 21)

Recap: I've built a Prusa Mendel 3-D printer from a kit I purchased from nwreprap.com.  I'm in the middle of performing some additional steps to prepare the printer for a first print.  I'm following along with a set of videos available on YouTube.  To complete these steps correctly, you need to have installed the Arduino Driver.

Uploading the Arduino Firmware

Launch the Arduino Software (click on the Arduino icon)



Click File in the menu bar, choose "Open" and navigate to the Sprinter software that you downloaded.  There should be either a file called "Sprinter.pde" or a file called "Sprinter.ino" there depending on the version.  Highlight it and click "Open".  Files with ".pde" or ".ino" extensions are known as "sketches" in Arduino software.



Now you'll see a multi-tabbed interface.  The sketch file appears in a tab called "Sprinter" and all of the other files in the same directory are opened in additional tabs.  All of the available tabs are available from one menu that is accessible from an arrow icon near the upper-right of the window.



You need to switch to the tab that holds the Configuration.h file.  If you don't immediately see this tab, look for it on the "All Tabs" menu on the upper-right.

Once in the Configuration.h file, some lines are commented out by using two slashes and some lines are "set".  Lines that are commented out are there as merely a "comment" and have no real effect.

For example:
//#define THIS_IS_COMMENTED_OUT
#define THIS_IS_SET

make sure that the following values are set up somewhere in your Configuration.h:

#define MOTHERBOARD 33
#define BAUDRATE 250000
#define SDSUPPORT
#define SDINITFILE

Note that the calibration steps that I will describe in a later blog entry will require us to come back to this file and change other parameters such as _AXIS_PER_STEP_UNIT

Next, save the Configuration.h file by clicking File..Save

Next, make sure that the board and the serial port are set correctly.  Your serial port might be different than the one in the screen shots.





Next, compile and upload the software to the Arduino.  Make sure it is connected to your PC.



The progress is displayed at the bottom the Arduino window



You should see this when it's complete: