(Original post from the 3D Printing Experience blog)
Updating info Nov 5th 2017- updating to match latest marlin firmware and to straighten out some of my image rotating which confused some people with orientation. Also to add a few extra bits and info.
If your printer is like mine you may have noticed that prints really aren't centered on the bed of the printer.
Now some printers have adjustable end stops so you can just turn a screw and set where the printer aligns it's self, But most don't have this. And honestly, unless it's really off, or you are going to print something right to the edges of your printers limits, it's not going to matter. But, it bothers me, so I went and learned how to center it. And it's not really all that hard to do. It took me a few days of reading and research to figure it out, and once I did I found it takes very little time to actually center it. So I wrote this so others can do it without having to spend the time figuring it all out.
Now you will need to be at least basically familiar with Marlin firmware and using Arduino or other software but it's not all that hard to figure out.
First step is to make sure your printer is all leveled and set correctly. It's best with this to use PLA, on a taped bed so you can mark it all up. you can just print what ever and take measurements from the edges if you don't want to use a marker on your bed, but this makes it so much easier.
Tape up you bed and move your print head to extremes, Mark the nozzle location as it often time will hit a carriage before it gets to the end of the printers bed
Draw Straight Lines down the edge of the bed where the nozzle actually stops
draw lines from corner to corner to create an X at the center point of the printable area.
Also if you write where your end stops are it will keep you from getting it spun around after printing and you go and take the glass (or what ever you are using) off.
Now download the centering target file, and slice it.
Download --> Centering Target <--
Best use is if you can print at your highest resolution your printer can do and not use any rift or brim if possible. This will allow you to see the marks on the bed through the print.
VERY IMPORTANT - Now make sure you right click on the target and select "center on platform" (this is with Cura, others may have a different command to make the target centered Make sure you use it)
save the Gcode and print it out. After printed take a look at where it lands on the bed. the lines are 5mm space. my X lands right in the corner of the 1st 5mm box, actually just inside, right at the corner. So I'm gunna just say -4.5mm for both X and Y in this case
Now that you have measurements, you can open up your Marlin firmware file and select the "Configuration.h" tab ..
Scroll down to the bottom of the "Z probe Settings" ("End Stop Setting" in older version of marlin)
These are the spots where you will enter the measurement you got from the print.
Adding a negative number shifts the bed toward the end stop, (the print away from the end stop) adding a positive number can't be done. Why? because that would make you buildable area out beyond your end stops, which it just can't do, cuz, you know,.. it'll hit the end stop.
Enter your measurements you got off the print, compile and upload to the printer. you should be set now and all your prints should be close to center on the bed.
And print the target again to check and make sure you did it correctly...
Now you're prints will be properly centered on the bed from now on :)