Bed Leveling screw locations - relative to what?
-
Railcore with 3 Z steppers. Question about M671 (and G30).
Documentation for M671 says "The X and Y coordinates in M671 are measured from the origin X0,Y0 set by M208."
Documentation for M208 says "The axis limits you set are also the positions assumed when an endstop is triggered."
So if you have:
M208 X0 Y0 Z-0.5 S1
Then when the carriage hits the X and Y end stops, that's (0, 0), the machine origin. The problem is, that's a carriage position, not a point on the bed. So I have no way to know what bed point to measure the lead screw location from. Machine coordinates don't have a specific point on a carriage, like a nozzle.
Should the lead screw locations be specified relative to the probe (or some other specific point on the carriage) when the carriage is at the machine origin? The probe is the only logical possibility I can think of, but the docs don't say.
There's a similar uncertainty about the G30 X and Y parameters, but there it seems like a reasonable inference is to use the machine coordinates which will put the probe at the point on the bed that you want probed. It's from that assumption I draw the more tenuous inference about the screw location measurements.
-
@DonStauffer everything is relative to the nozzle
-
@DonStauffer You're right, the point everything is measured from is arbitrary. However, you need to choose something to reference everything else from. We call it the Head Reference Point, and it is described here: https://docs.duet3d.com/User_manual/Tuning/Defining_tool_and_Z_probe_offsets
Ian
-
@jay_s_uk Which nozzle? I have two. And my understanding is that probe points, for example, use machine coordinates, which have nothing to do with nozzles.
-
@DonStauffer well I would assume you have your second nozzle offset from the first one? In which case, the first one.
Unless you have something like an E3D tool hanger where the z probe on the carriage is typically the 0,0 location -
@droftarts Please tell me if I understand this right:
Just analyzing Y, to keep it simple: My primary nozzle is at -22mm from my BLTouch probe; my secondary nozzle is at -45mm from the probe. When the carriage is against the front end stop, the probe is 62mm from the front edge of the bed. I have a lead screw which is 100mm from the front edge of the bed.
Assume M208 uses Y0. So, if I choose the probe as HRP, my M671 Y parameter would have 100-62=38 for that lead screw, and if I wanted bed leveling to probe right beside that pivot, in bed.g, the G30 Y parameter would also be 38. Presumably, if I executed T-1 and then G1 Y38 (or just G53 G1 Y38) it would also move to where the probe would be beside the screw.
My usable bed space begins 30mm from the front edge, but since my primary nozzle can't reach that, and my secondary would run into some bed clips anyway, the furthest front my practical usable bed space can start is where the secondary is 30mm from the front edge of the bed, putting the primary nozzle 30+23=53mm from the front edge. The carriage is 13mm from the end stop there. To move the secondary to where the primary was adds 23, putting the carriage 13+23=36mm from the end stop.
Then, to make tool coordinate systems use the printable space starting at zero, my G10 P0 will have Y-13, and my G10 P1 will have Y-36. (I probably could use the secondary with negative Y values without hitting anything).
Does this seem correct?
-
@DonStauffer The problem I have with this is:
Suppose instead I choose the primary nozzle as my HRP. Relative to that, my lead screw is at 38+22=60, so my M671 gets Y60. But, I still want to move the carriage to 38mm from the end stop, so my G30 has to have Y38, right? If I do Y60, that would put the primary nozzle even with the lead screw; not what I want. Then what is the point of M671 Y60? And how does bed leveling know my probe is next to the lead screw? It just knows I said to move 38mm, but it doesn't know I have my lead screw location relative to the nozzle. All it knows is M671 Y60 and G30 Y38. But if I do G30 Y60, presumably it will probe with the carriage 60mm forward of the end stop; the probe won't be next to the lead screw.
So there's something I'm not getting. I know how I know where the lead screw is and what it's relative to. But how does the machine know? I haven't told it what "60" is relative to.
Perhaps this has something to do with G31? Would I have to specify G31 Y22, where using the probe as HRP would use G31 Y0, and that's used to interpret screw locations in M671? If that's the answer, then it raises the question of whether to use G30 Y38 or G30 Y60 in bed.g. I'd guess the latter, although that has the odd (but convenient) characteristic that the coordinate specifies where the probe goes rather than where the HRP goes, unlike for example G53 G1 Y60, which seems like it would move the primary nozzle even with the lead screw in any case.
Am I on the right track?
-
@DonStauffer - the way I think of it is that when the X and Y axes are homes, they are defining a position of the "machine" coordinate system, and I set the M208 X and Y values to numbers that make that "Machine system" make sense.
On my machine, I marked a small dot on my build plate that I wanted to be the corner of the build area and I also wanted this to be x=0 and Y=0. I adjusted the X and Y in M208 so that after homing, if I sent the machine to 0, the nozzle would be above the dot I made. On my machine X homes at the left of the machine and Y homes at the front. And those positions are off teh build plate, so my M208 X and Y values are both negative.
After that, when I tell the machine to go to an X,Y location, it moves the nozzle there.
You can set an offset on your probe using G31 (https://docs.duet3d.com/en/User_manual/Reference/Gcodes). This is the distance (X and Y) between the nozzle and the Zprobe. After that is set, when you tell the machine to probe at a location, it will apply those offsets to the move so that the probe is at that location. And depending on the physical machine limits, you may not (most likely will not) be able to probe every edge of the bed. You need to take that into account when you set up you mesh probe limits.
-
My lead screw is at 38+22=60, so my M671 gets Y60. But, I still want to move the carriage to 38mm from the end stop, so my G30 has to have Y38, right? If I do Y60, that would put the primary nozzle even with the lead screw; not what I want.
My X/Y origin is centered, and I have two nozzles and a probe as well. For me, that’s quite an intuitive setup, never had problems implementing this scheme. But the way you wrap your brain around it makes me crazy: It’s simply insane to mix selected GCodes with the geometric idea. I propose not to do that.
It’s so simple: as @jay_s_uk pointed out, ”everything is relative to the nozzle” - or, more precise, relative to a single point of the print head. For practical reasons, take the primary nozzle for that.
This point (of the head) can be moved around within the physical limits of your machine - two of these limiting points are usually defined by the X and Y endstops. Once you’ve probed these (X and Y), you have a known physical area which cannot be exceeded (and should not be fully exploited).
Now, tape some paper onto your print bed, cross-mark the center of it, then jog the printhead (i.e. its reference point) over it. Note the X/Y coordinates, these will later be used to define 0/0 of your printable area. The printable area is the single one coordinate system your machine will operate in, after doing some homework (scripting), you can simply forget about all offsets, relations or conditions. It just works.
Having two nozzles and a probe, however, makes defining the printable area a bit tricky: each of these head components must (well, in most cases) be kept within the bounds of the printbed. Jog the head around, try and test the limits on all sides, in all corners. For all these cases, mark the position of your head’s reference point on the paper. Measuring the distances to the center, you get your ”logical” X/Y coordinates.
At this stage, you have a coordinate system (for the X/Y plane) which is ready to use. Furthermore, you are safely within the mechanical limits of the machine and the printable area as well. Any slicer which has the basic parameters - centered origin, tool offsets, printable area - will generate appropriate GCodes.
Talking of GCodes: sure you have to tell the Duet about geometry and physical dependencies, but be assured: there are GCodes for all of that. First, you have the idea plus some coordinate values which define your ”logical” coordinate system. Then, you either look up the GCodes in the dictionary, let the setup assistant propose some template scripts, or ask the forum.
-
@DonStauffer Like I said, the point you choose to reference everything from is arbitrary, and up to you. Like @infiniteloop, I always have the origin (ie X0 Y0) centred on the bed, and choose to set the first tool's nozzle as having a zero offset from this point. For having the origin centred on the bed, see https://docs.duet3d.com/User_manual/Tuning/Bed_origin
Ian
-
@mikeabuilder That seems pretty confirmatory for what I was guessing. The part that's missing from the docs as far as I can tell is where you described the G31 probe offset being applied when G30 needs to probe the bed. The docs on HRP mentions that you should set it, but not how it affects what gets done.
It seems like most people do what you did with M208 using G10 to create another coordinate system, which especially makes sense if you have two nozzles. One coord system for each.
I think I'm beginning to get it.
-
@infiniteloop It was specifically how the GCode part of it interacted that I didn't understand. The HRP is explained, and the GCodes are named, but how they interact seems to be a weak point of the docs.
Thanks you, everyone! It's been very helpful and I think I have it worked out now.
So here's the end result, in case it helps any future enthusiast to have an example:
The measurements I used in this discussion were rounded versions of my real machine to make it easy to talk about; this image contains the real values. Here's the actual geometry and what I settled on for settings. I left M208 X0 Y0 and used the probe as HRP, which simplifies the probing issue, and using the primary nozzle seems like it complicates and confuses things when using the secondary. In theory, my 2 nozzles and probe are supposed to all have the same X coordinate, but I had to fine tune it so the 2 nozzles come out in the same place given the same G0 or G1 command, and in real life they aren't quite in a line.Regarding bed leveling, it's my understanding that the probe points need not all be in exactly the same relation to their respective screws as one another - that the differences are compensated for in the math. I did the best I could on each one, but naturally the machine home prevents getting toward the front enough to be close to the front left probe point. and the fans are in the way on the right probe point. My leveling isn't actually all that repeatable, but I'm assuming that's my build material not being held down well enough (PEI 2mm).