Making sense of Zero

Post Reply
Warren
Posts: 3
Joined: Wed Jun 15, 2016 1:55 pm

Making sense of Zero

Post by Warren » Sun Jul 31, 2016 1:26 pm

Making Sense of Zero

After having added an automatic bed leveling sensor. I was surprised to find myself confused, because when I would tell Repetier Host to Go “All home”, I was finding that the print head was not close to dead center of the heated bed anymore. After a head knocking hour I figured out that “All Home” was now putting z at the center of the print bed but it’s in relation to the sensor.
The reason it gets confusing is because there are the printer settings in the Print Host software which includes a print head offset and max printable space. Also there is the bed dimensions in the firmware.
Both of these work together in simply finding “home” and auto bed leveling.

Finding Home

In figuring out home, it’s all in the printer firmware. First there is the section for travel limits after homing. This section has the X, Y, or Z_MAX POS ###, and the same for MIN_POS.
The “MAX” are the maximum travel on the printer. Be it for the print head or the print bed.
Take a moment set all the max entries to 200, flash the firmware then connect to the printer. Raise the Z axis 10 or 20 millimeters just so it’s not going to hit the bed.
Home the X axis using the software. Then start stepping it across the working area. Start slow note down the number when the print head is over your usable print surface. Save it we’ll need it later. Continue jumping across the work space until your close to your supposed end side. The glass has been cut smaller to fit between all the bed leveling bolts so it’s going to affect your available working space. As you get to the end of the end far end of the glass/print surface again note down the x axis value and save it. Now continue in small steps until you hit the far side or the 200mm limit you set earlier. If there is still room available, you might have to go into the printer settings in Repetier and increase its max value by 5 or so then continue moving over. If you hit the end of travel take that value (x in this case) subtract 1 and note it down. This number will be your X_MAX_POS ### where the # is the digits you just noted down. But we’re not ready to update that yet.

Repeat these steps to get your Y bed dimensions.

Z is a bit hazy now since it’s flexible with auto bed leveling. So we’ll come back to it.
With auto bed leveling, the z-axis zero point is now the center of the print bed.
Now we have to disconnect Repetier/printer control host from the printer and open up Ardruino with the firmware loaded. Now is the time to enter those X_MAX, Y_Max values on the respective #define lines in the “Travel limits after homing” section. Find the Auto_Bed_Leveling section and now we get to set the limits to the area to be probed while auto leveling the bed. Also you will be editing the probe offset values. Using calipers if you have them measure the X and Y distance between the printer nozzle and the auto level sensor. These values will be our starter values in the offset values. A side note here rather than deleting the existing value on each line and replacing it. Simply enter the new value in front of the existing value hit space and two / marks like so.
X_PROBE_OFFSET_FROM_EXTRUDER -25 // was -55
The “//” is the remark command and anything after it is ignored by the system so it is a great place to track your changes as you make them.
So now we have the Offset values for X and Y entered. Now move back to the rectangle in which to probe and now we get to use the “Usable print bed values” we took down earlier. The values for this section has a lot to do with where you mounted your sensor. If the sensor is on the left side of the print head you can use your minimum work space value for the LEFT_PROBE_BED_POSITION the RIGHT_PROBE_BED_POSITION will have to have the sensor Y offset subtracted from the max X axis printable space value. This should prevent the print carriage from slamming against the stop. If your sensor in to the right of the print head the reverse is true, you’ll have to add the offset to the LEFT_PROBE_BED_POSITION and just leave the RIGHT… at your max print value. It’s similar for the Y axis as I described it for the X.
Now, sadly there’s a bit more math involved. There is another entry in configuration.h we need to address. That is “#define AUTO_BED_LEVELING_GRID_POINTS 3”
That value, (in this case 3) is used to figure out how many places across the print bed it will probe. The math I was talking about is:
"Axis_Probe_Offset_From_Extruder "× "Auto_Bed_Leveling_Grid_Points"
And
"Right_Probe_Bed_Position"-" Left_Probe_Bed_Position"
If the Axis offset (x or y) times the number of probe points is greater than the available probe space the firmware will not compile.
This all boils down to you want your sensor as close as possible to the print head.

Let’s use my settings as an example
// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 16
#define RIGHT_PROBE_BED_POSITION 164
#define BACK_PROBE_BED_POSITION 150
#define FRONT_PROBE_BED_POSITION 10
#define AUTO_BED_LEVELING_GRID_POINTS 3
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER -25
#define Y_PROBE_OFFSET_FROM_EXTRUDER -35
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0

So my X axis is 149mm wide
The X offset for my probe is -25 So that’s 75 mm. So it’s good. Now all these values will be pretty much unique to every printer.
Verify and upload the firmware to the printer.
After the printer reboots, connect again to the printer from the computer.
Now before we continue, let’s take a moment and tweak the printer settings in Repetier Host. Hit the Printer settings gear in the upper right corner and then select the printer shape tab.
In the X and Y min you can set it to zero. X and Y Max set to the value before you hit the end of travel earlier.
In the Bed Left enter the value you got as the left most point of the print bed. For Bed Front enter the Lowest Y axis value you could print at.
Now the Print Area width and depth are the maximum workspace minus the minimum workspace values we got earlier. For now set the print area Height to your printer’s advertised height value. Hit apply and close it.
Now we can begin calibration of the auto level. The probe should be close to the same height as the print nozzle but only higher. How to do this?
Here’s how we’re going to do this. Home X and Y. If you’re using a Cartesian printer like the Prusa , your print head should be hanging in space off the left side of the print bed. Have a piece of metal or something to trip your sensor ready and tell the system to home z. It will either start dropping z at home or it will move to the center of the print bed (pretty close to the temperature sensor if it’s in the middle of the bed) and start lowering itself. When it actually hits the bed hit the Emergency stop.
Grab your digital or dial calipers and measure the distance from the bottom of the roller bearing on your z axis on one side then repeat the process on the other. Or whichever axis is being driven by two motors. Unlock/disable the motors and adjust the drive screw (all thread rod or acme rod) so they are even.
Now hit the Z up button one millimeter at a time until you can get a paper (I use a business card) under the print head. Once you have that done we move over to the sensor. If you have something you can use as a spacer, (like some scrap print filament that’s about one millimeter thick) place that on the print bed and now adjust your probe height until it’s touching the scrap. Ideally your sensor should be going off if it’s an inductive sensor. If it’s a switch your swinging down and using, get it low enough that it just trips.
Now with these two adjustments made, you can hopefully level your bed manually for the last time. Turn off the motors if they aren’t already, and move the print head and bed around and adjust for the paper or business card you used at the center of the print bed.
Alright. It’s time to see if all this work pays off. Hit All-home ( the little house) and watch X and Y home then it should move to where the sensor is center of the print bed and it will lower to zero.
If the sensor does not hit close to the center of the print bed you need to adjust the probe offsets. I did this myself with some painter’s tape and a Sharpy. I would use the tape to mark where the sensor landed and then see where the center of the print bed is. Then I would adjust one value at a time until I land it close to the center of the print bed.
This has a bearing on where Slicer will position your objects to be printed. Not doing this could end up with your print running off one side of the bed and making a big mess.
Once you have found the correct offset values. We can move on to testing the auto level grid search. In the G-Code line type G28 this will send all the axis to home and you will see some of the hunt and peck the z axis will do trying to find zero. Once it stops, enter G29 into the G-Code line and hit Enter or send. The printer will now start its grid search by raising up a ways and moving around to nine different points to find zero. You will see lines like these:
22:14:13.581 : Bed x: 16.00 y: 150.00 z: 0.29
Appearing in the log. The important number is the last one z: that is the difference between z Home zero and where it sensed on the print bed. All the adjustments for the bed level will be made in the firmware. Because it has made sense of zero.

We are not quiet done yet. Run a simple test print (a bed leveling calibration print will do fine) see if you're getting a good first layer. If not, it's now a LOT simpler to adjust it. We do it in the slicing software. You've probably edited your starting G-code for the printer settings there should be a line in there for G92 Z1; Lower = Z Pos, Lift = Z Neg (Everything after the first semi-colon is just a comment)

You can adjust Z right on this line for a good first layer. A hole lot simpler than all the cards and screw drivers and tweaking the bed.

Post Reply