Wednesday, October 27, 2010

Building a Prusa i3 printer - Testing and calibration

We will power up the electronics with nothing connected first and take things one step at a time.

Please read carefully – you can damage your electronics if you do things out of order or forget a step.
  • Troubleshooting tips are indented like this.
First off, I will assume that you have completed your electronics build and have firmware loaded onto your board (If you got the electronics from me this will be the case).  If not you’ll have to find instructions for doing that somewhere.

For these steps, you will need to have at least Pronterface running on your computer.  See the software page in these instructions to get your computer ready to go.

Before we proceed to apply power to your electronics for the first time, check it carefully to make sure the motor drivers and the CPU are plugged in the right way by noting the position of the notch on one end of the big CPU chip, and the location of the adjustment screw and chip on the four driver chips.  If you have a motor driver installed incorrectly, you will smoke every last part on the board in about 2 seconds.

Start with the electronics either mounted to the printer safely or sitting on a non-conductive surface so that you don't short anything out by lying it on top of a screw or something.

Adjusting drive current

It is CRITICAL that you adjust your drive current on each motor control board.  It must be high enough so that the motors are strong, but not so high that the drivers overheat or are damaged.

It is possible to adjust the current by simply starting with them turned down all the way, then turning them up until you’re happy with the setting.  But the more accurate way is to probe the test point on the driver with the motor attached and the unit powered up, and adjust for the proper voltage.

On the photo below you can see the adjustment point (circled in blue) and the test point (circled in red).  Everything on that board is tiny and you have to be careful to not short anything out.  A sharp test lead on your multimeter is good.  If you are using some other brand of driver board that does not have the test point, you can also touch the probe to the metal part of the adjustment control to get the same reading.



Before we proceed and apply power to the electronics for the first time, double-check that the polarity of your power connector is proper (plus and minus are on the right pins).

We are not connecting electronics to the computer or motors to the electronics in this step.

Attach the negative lead of your multimeter to the negative power supply connector with a test lead or something so you don’t have to hold it there, as you’ll need both hands for this procedure.  Double check that you have turned the adjustment screw on all four controllers all the way counter-clockwise.  Now apply power to the electronics.  Set your multimeter on “volts” and make sure that your probes are plugged in properly to the volt position (NOT the "amps" position if your voltmeter has a separate plug for that).  Now probe the test point.  Turn the adjustment pot to get to the proper setting.

The board can deliver up to 2 amps per winding, though only with heat-sinking.  It can deliver 1 amp and a bit more without a heat sink.  I find that I can drive plenty of current to make my motors quite strong without any heat sinks.

A measurement of 0.4 volts (400 mv) at the test point is equivalent to 1 amp of drive current.  I generally push them to 430 to 450.

When you have set the drive current on all four controllers, disconnect the power from the electronics.




Motion and wiring test

We will now plug the electronics into the computer.  For now, I suggest plugging the electronics into a USB hub rather than directly into your computer’s USB ports, if you have a hub.  That way if there is a wiring error in the electronics that causes bad things to happen, it will damage a hub instead of your computer.
  • If at any point the printer is doing something you don’t like (bashing hard up against an end, breaking itself, smoking, catching fire, abusing the cat) you can either click the “disconnect” button on Pronterface or just yank the power jack out.  Either will make it stop instantly.  Be aware that bashing up against an end sounds horrible but it actually doesn’t cause harm as long as you don’t do it a lot.  You’re almost guaranteed to do it once or twice during this process.
Remember during this step, DO NOT make wiring changes (connect or disconnect motors or anything else) while 12V power is on, this can damage the motor drivers.

Confirm that there is nothing attached to the electronics except the power jack (the actual power is not applied yet).  Plug the electronics USB into a USB port on your computer or USB hub.  This powers up the CPU (though not the motor drivers) and you should see the power LED light up.  Install drivers if it asks (see software install page).

Now start up the Pronterface software.  Select the appropriate COM port in the upper left (should be the highest numbered one since it’s the most recently added device).  Select “250000″ as the baud rate (unless your firmware is compiled to use a different baud rate).  Click “Connect.”

After a delay of 3 to 10 seconds, you should get a “printer is online” message on the status window on the right and possibly a whole bunch of other information about the printer.  This confirms that your electronics are alive and a firmware is loaded, and that your computer has the proper drivers.  Click the “disconnect” button.  It is not necessary to unplug the USB port since the USB only powers the CPU, not the motor drivers.

Now plug the X motor and the X endstop to the electronics in the proper position (the end nearest the power plug in both cases).

Apply 12 volt power to the electronics (hold breath and hope you don't see smoke at this point :) ).  Click “Connect” on the Pronterface interface.

Press “home X” on Pronterface.  The motor should move towards the endstop until it hits it, then stop.  You should then be able to push +/- X controls and make the motor move back and forth.
  • If it bashes up against the endstop, there’s a wiring problem with the endstop.
  • If it goes the wrong way, the motor is wired incorrectly, double check.  If it appears correct you can either swap the wires going to either of the two windings (swap 1 and 2, or swap 3 and 4) or you can change the firmware and recompile (I recommend fixing the wiring, otherwise you’ll have to remember to fix the firmware every time you upgrade it)
  • If it doesn’t move at all, there may be a wiring problem with the motor, or with the electronics.  Double check everything.  You may wish to try moving the motor and endstop to the Y axis and try there, to rule out or confirm an electronics issue.
  • If the motor will only move in one direction, the firmware might be compiled with the wrong endstop settings.
  • If it just hums, the drive current may be too low – use the preceeding procedure to check.
  • If it only moves a little bit every time you hit "home" then the endstop may be stuck or wired wrong - it thinks it's up against the endstop and is trying to move the carriage away from it.  Check the wiring.
Once you get things satisfactory there, disconnect the power connector from the electronics, then plug in the Y motor and endstop.  Repeat the procedure with that axis. 

Repeat with the Z axis (there are TWO motors there, remember).

Extruder calibration
The "steps per axis" values on the movement axes can be simply calculated and should be OK, but the extruder must be calibrated.

To start with, hook up the extruder motor and confirm that it turns the right way - when you hit "extrude" on Pronterface it moves in such a way that would push filament towards the hotend (clockwise on a Wade's extruder).

To do the calibration, you must not have the hotend mounted.

Use the jog buttons on Pronterface to move the Z axis up quite a ways, like 100 to 150mm.  This gives room to work.

Load a piece of filament into the extruder and turn the wheel manually until the end of the filament is just even with the bottom of the extruder.

In Pronterface, below the "extrude" button, type in "100" mm, then hit "extrude".  Measure how much filament comes out.  If it's exactly 100mm, you're done.  If not, follow this procedure:

You need to know the steps per millimeter value that was put in for the extruder when the firmware was configured.  For this example, let's assume it was 450.  Let's also assume that we got 85mm of filament out when we asked for 100.  Multiply the ratio 100/85 by 450, giving 529.  That's your corrected value for steps per millimeter.

You can either go back into the Arduino code and modify steps per millimeter, or you can go into Pronterface and next to the "send" button type "G92 E529" (use your value instead of 529 obviously) and hit "send" then type "M500" and hit "send."  This changes the value and writes the new values to permanent memory.  I prefer to recompile the firmware but the other way is easier.  If you have an LCD panel it's even easier, you can modify the values on the panel and save the values.

Remove all power (including USB) from the electronics, reapply power and USB, then retract the filament back to the starting point and extrude another 100mm and confirm that you get 100mm out.



Hotend testing and calibration
Good hotend temperature control is critical to good prints.  Marlin uses the PID system which results in great temperature control, but the firmware must be calibrated to "know" your hotend and heating element for good control.

To start with, let's just do a simple sanity check.  With the hotend heater and thermistor and the hotend cooling fan connected to the electronics, connect to the printer with Pronterface and either click "watch" or press "Check temp" (these are circled in yellow below).  The temperature reading for all the sensors is in the lower left of the window (circled in green below).



 In the example it says 22.4/0 - this means that the current temp is reading as 22.4 and the set temperature (the temp that you've told the printer to hold) is 0 (off).  If this is not a reasonable temperature (IE it's about the ambient temperature of your room) then STOP and figure out what's going on.  If it reads 0, probably there's a bad connection to the thermistor or you're plugged in to the wrong thermistor port.  If it reads really high (hundreds of degrees) then probably there's a short in the thermistor line.  If it reads a weird non-zero value, then it's possible you have selected the wrong kind of thermistor in your "configuration.h" file in the firmware.

When you're OK with this, we're going to do just a very mild test.  Type something like 30 dgrees into the box next to "heat" and click "set" - monitor closely and be ready to remove power if the temperature starts to climb really high (like over 50 degrees).  With PID not calibrated it's possible you'll get overshoot especially if you have a powerful heater such as a cartridge heater, but the hotend can take about 260 degrees so this test should be safe.

When the temperature has stabilized near 30, carefully and quickly touch it.  30 is below body temperature so even if it's off a bit it should only be warm.  If it's uncomfortably warm, something's wrong, investigate.

Now click "Off" next to heat and see if the temperature starts to drop.

You can do an additional test if you have some way of measuring the temperature - a thermocouple on a multimeter would be ideal.  If you have that, put 100 into the field and click "set".  When the temperature settles down, check the temperature.  It WILL read lower than the printer says because you can only test the surface temperature, but it should be within 20 degrees.  Turning the fan off or redirecting it will help you get a better surface reading.

Turn the heat back off and let it cool.

Once this is all working, we need to do a PID calibration.  Be sure your hotend cooling fan is running or your calibration will be off
.
Click here for an article on PID calibration. Follow the instructions on this article.

Once you have put the new values in to the PID for the firmware and uploaded (or saved to EEPROM), you should be able to put values in and it should just go up to that temp and stabilize there without overshooting more than a couple of degrees at most, and should hold within less than a degree without trouble.  Check the temperature accuracy again with your probe if you have one.

This should conclude calibration of the hotend.

No comments: