This is a follow-up Instructable to one I wrote a couple of years ago. This one builds off the original by adding a new technique to measure the X,Y, and Z axis, quicker and with more accuracy.
I will still be referring to the original Instructable, as it goes into more detail on teh math and how to input the calibration values.
While I'm using a 3D printer, this technique would work just as well for any CNC machine that uses G-code.
If you find this Instructable helpful in anyway, please vote for it. Thanks!
1. 3D printer to calibrate
3. cheap laser pointer
2. 3 rectangular neodymium magnets
3. Hot glue gun and hot glue
4. A fine tip marker or a sharp pencil
6. digital calipers or ruler (if your eyes are really good)
5. painters tape
6. a sewing needle, a thumbtack, or something thin and pointy.
1. 3 AA or AAA battery pack (with batteries)
2. 2 alligator clips
Step 1: Attach Magnets to Printer
First you will need to find 2 places on your printer where the magnets will go (Pictures 2 and 3 show where I've attached them on my 'Printrbot Simple 1405 makers kit'). You should be mindful where you put them, making sure that when your printer moves around it will never be too close to any of your motors, linear rails or anything else ferromagnetic.
Picture 1: heat up your glue gun and glue the back of your first magnet.
Picture 2: Attach it to printer so that it is perpendicular and directly over the print bed. This is where your laser will point down from and will be used to mark your X and Y axis (laser will be pointing at print bed)
Picture 3: Making sure to keep the north/south poles of the magnets consistent, glue and place your next magnet perpendicular from your first. This will be used to mark your Z-axis points (laser will be pointing at wall next to printer)
* If you can't find any place to put your magnets because they'll interfere with your motors, you could try velcro, or make a 3D printed rig that the laser pointer fits into.
Step 2: Prepare Laser Pointer
Now let's glue a magnet to the laser pointer so that it can be attached to the printer and setup its power source!
Picture 1 & 2: tape the button closed, so that the laser can be left on without directly touching it.
Picture 3: attach a magnet to the laser (make sure you have the right pole facing outwards so it will attract to the magnets on the printer instead of repel)
If you don't have button cells batteries for your pointer and want to use AA or AAA instead... This makes it less of a pain to turn the laser on and off... (i.e. just cut the power).
Picture 4: Connect an alligator clip to the spring inside your pointer (this will be ground).
Picture 5: Connect a second alligator clip to the back of the pointer
Picture 6: Put 3AA batteries in a battery holder and connect your alligator clips to it (black wire from battery pack (ground) to spring in the pointer (ground), red wire (+4.5V) to metal body of pointer)
Step 3: Make a Smaller Laser Point
I found the laser on its own was making too large of a dot, so let's make it smaller!
Picture 1: Get some tape and make a small hole in the centre of it. I've used a sewing needle here.
Picture 2: Place the tape over the pointer, allowing the laser to only pass through the little hole.
Step 4: Mark and Measure Laser Points for X-axis
If you haven't already, attach your laser pointer to the first magnet that you glued to your printer.
Picture 1: A small dot where the laser is pointed.
Picture 2: Use your fine marker or a very sharp pencil to make a dot where the laser is shining. If you're having difficulty seeing your mark, try a lighter colour of tape (i.e. masking tape), or tape a white piece of paper flush against the printerbed surface. Using graph paper would be ideal.
Pictures 3 & 4: If you're having trouble seeing whether you've placed a mark in the right spot, rapidly block and then unblock the path of the laser.
Picture 5: Using your 3D printer software (I'm using Repetier) move your printer 100mm (or however far you wish to move it). mark this point as well. Make sure to be consistent in which part of the lasers dot you mark.
Picture 6: Use your calipers to measure the distance between the dots. If it's close to 100mm (or however far you tried to move it) then great, the X-axis is calibrated nicely. If not you need to change your M92 value, I'll briefly go over it here, but for a more in depth guide, go to steps 1 and 2 from my original instructable.
The M92 value for a motor is basically g-code for - how many steps the motor should move in order to travel a desired distance. make note of your current M92 value for X. My current M92 here is 80.03
In this example, 100mm is my "desired movement" and 100.02mm is my "actual movement." .. In reality, I probably wouldn't change anything because 0.02mm would most likely have been a mistake in my measurement or markings... but lets solve for it and enter our new M92 value anyway.
New M92 X = actual movement / desired movement * current M92X = 100.02mm/100mm*80.03 = 80.04
Now I can input "M92 X80.04" into my manual g-code control and save it by entering "M500". Then I check to make sure everything saved properly by entering "M501".
*Make sure to check up on the tension belt for your X-axis from time to time. Be sure it's taut and not sagging, this will help keep your printing results consistent.
Step 5: Mark and Measure Laser Points for Y-axis
Keep your laser pointer attached to the same magnet and home your X-axis if you like.
Picture 1: Mark your starting point
Picture 2: Using your printer software, send a command to move your Y-axis 100mm and mark that point as well.
Picture 3: Measure the distance between start and finish.... Looks like my printer doesn't move enough, (it went 99.37mm when I asked it to move 100mm) so I'll need to increase my "M92 Y" value accordingly. You may want to take a few measurements and average them out before changing your M92 values.
Following the math from step 3 of my previous Instructable, 100mm is my desired movement, and 99.37mm is my actual movement.
In this example, we have a current M92 Value for Y equal to 79.9.
New M92 Y = desired movement / actual movement * current M92 = 100mm/99.37mm *79.9 = 80.41
Now I'll enter "M92 Y80.41" then save it with "M500", and double check that it saved properly with "M501." Try marking and measuring again to see if you've successfully calibrated your Y-axis.
*Make sure to check up on the tension belt for your Y-axis from time to
time. Be sure it's taut and not sagging, this will help keep your printing results consistent.
Step 6: Mark and Measure Laser Points for Z-axis
Now move your laser pointer to the second magnet you glued to your printer.
Picture 1: Shows laser in new location
Picture 2: Put a piece of painters tape on the wall where the laser is pointing or a tall and sturdy book. Again, mark the starting and ending point before and after moving Z-axis 100mm. If you find it hard to see the markings, take a white piece of paper and tape that to the vertical surface.*
Picture 3: measure distance. I found it easier to mark on a book, then put it horizontal to measure it..
Again, my printer isn't moving enough.. its actual movement is 99.45mm but my desired movement was 100mm. Maybe I didn't mark the points perfectly or maybe I measured poorly. Either way, I'll measure again and average the 2 results (or 3 if I decide to do it again) before changing the M92 value.
Again you can look up my previous Instructable (Step 4). for a more in depth look at solving for our New M92 Z.
But basically, I check for my current M92 (with M501 command), which is 2036.85, then solve for new M92.Z
New M92 Z= desired movement/actual movement*current M92 Z = 2048.11
I then enter "M92 Z2048.11" and save it with "M500" and check to make sure it saved properly with "M501"
And that's it, your XY and Z axis should now be nicely calibrated! YAY!
I'm working on a better way to quickly calibrate my 'M92 E' value (to tell the printer how much filament to extrude), so check back soon. in the meantime, check step 5 of my previous Instructable
I hope this Instructable was easy to follow and helpful. Leave a comment if you have any questions.
*Not having a level floor or perfectly perpendicular wall might alter your results (to what extent, I'm not so sure).... If you're using a book, try and line it up parallel to your printer
** Make sure your threaded rod is properly lubricated, this will help keep your printing results consistent. I've heard sewing machine oil works well. I've also read that graphite powder can be used. Stay away from vegetable oils which can go rancid, and thicker greases or oils that can attract dust.