How do we want homing the z-axis to work

The system takes into account the z-axis height when computing the belt lengths. It doesn’t have a huge impact on the belt lengths but it does matter.

For it to be accurate we need a system so that the machine can “home” it’s z-axis position. Basically we want to lower it down to the limit and then internally set the position to zero.

How do we want that to work? Is it going to be annoying to run with a router bit in place? Should it lower down and then lift back up to some height?

1 Like

I was thinking about this while thinking about changing the Z dialog. I don’t know if this ought to be something that can be added to calibration (or a “z” calibration?). I would like to have a “system 0” at the bottom of the stepper’s motion and “system top” at the top of it (software limits). Then we can have a button to go all the way up (or down for calibration). Right now to get to the top its kind of “keep going up till you hear a clicking sound”. There does not appear to be any gcode for “go to limit” unless I missed it.

As to specifically homing Z. I think that

  1. we should save the relative Z position over restarts, which I think is not happening right now. Better would be to also know the “real” stepper z position also as mentioned above.
  2. I don’t think we can know Z “limit” without taking out the bit and flooring it out manually, but “cut operation limit” can / has to be a user process of lowering until the bit hits the workpiece 0. I’d love for there to be an automated way of doing this like someone mentioned elsewhere with a probe connected to the bit/collet and a plate under the sled, but manual works for me.
3 Likes

Maybe this is the place to start? We know the z-axis position at the end of calibration (0) and then we can save it from there?

That would also lay the ground work for starting to remember belt lengths through power cycles too.

2 Likes

The Z moves much more easily than the belts, so I would be much more nervous
about maintaining it over a restart.

there are multiple needs here

  1. square up the Z (if one lead screw had turned and the other hasn’t)
  2. get to a known position (run down until the motors both stall)
  3. set the Z=0 for cutting
  4. set the soft limits so you don’t move up past the ends of the threads (the
    clicking) because at that point you don’t know where you are any longer

more later, have to run out for a bit

David Lang

2 Likes

Regarding 2, to get to a known position on Z many CNC’s raise Z not lower it to find the limit. Because this allows you to find your machine home with a tool installed. In our case we can raise until current threshold limit then set a soft limit in the user interface on the downward travel.

Regarding 3, there good reasons to set Z will be set to zero for other than cutting. The zero point for Z and all axis should be independently settable by the user so jobs can be run with tools installed without actually cutting the workpiece. This is critical for testing a job (seeing the tool run speed and trajectory) before running cuts on $100 sheet of x material. After the test run then we need to be able set Z=0 again but now at the workpiece surface so the actual cut can be made.


Other control software seperate machine home from workpiece origin XYZ zero. The machine home resyncs encoders and software based on the machine limits. Periodically we machine home to Z’s safe home so that you can then travel to your workpiece origin XYZ

image

3 Likes

In looking into how to store the z-axis position (and eventually belt lengths) persistently it looks like

void Coordinates::set(float value[MAX_N_AXIS]) {
    memcpy(&_currentValue, value, sizeof(_currentValue));
    if (FORCE_BUFFER_SYNC_DURING_NVS_WRITE) {
        protocol_buffer_synchronize();
    }
    nvs_set_blob(Setting::_handle, _name, _currentValue, sizeof(_currentValue));
}

in Settings.cpp is what we might be looking for. I’m pretty sure that’s how FluidNC is storing the home position which persists when power is lost. I asked in their discord about it and got a kinda helpful answer. I’m going to keep digging into how it works.

1 Like

nice find!

2 Likes

My two uneducated cents.

I think we need two z values stored to apply z limits in the software without using actual limit switches.

First the “real z” would be the known distance of travel on the maslow itself.

Second the “cutting z” would be the zeroed point with bit installed (hopefully with the auto z firmware added, like maslow Classic, metal ruler works amazing)

Tracking the two would allow software limits.

Example. Let’s say the “real z” travel is 0-30 cm (I don’t have a maslow 4 yet, so guessimating) 0 when the sled is bottomed out and 30 when it is at the very top. This could also be used for any changes in belt geometry equations and would be used as software limits of travel, as the numbers would never change.

Zero the machine with a 5 cm bit installed. The “cutting zero” would be zero, but the real zero would be at the 5 cm measurement. This would apply limits at -5 cm depth of cut as it puts the “real z” at 0.

This just sounds the easiest way of doing things with my limited knowledge. Ready for the heavy criticism. :slight_smile:

3 Likes

Yes this is what I was trying to say but you said it much more eloquently! Nice!

2 Likes

gazinux wrote:

]

Regarding 2, to get to a known position on Z many CNC’s raise Z not lower it to find the limit. Because this allows you to find your machine home with a tool installed. In our case we can raise until current threshold limit then set a soft limit in the user interface on the downward travel.

when we raise the Z we just run off the top of the leadscrews, there is nothing
to run against, no current limit

1 and 2 are currently related, you run down with both motors until they don’t
move any more and you know that both sides are at the same place.

Regarding 3, there good reasons that set Z will be set to zero for other than
cutting
. The zero point for Z and all axis should be independently settable
by the user so jobs can be run with tools installed without actually cutting
the workpiece. This is critical for testing a job (seeing the tool run speed
and trajectory) before running cuts on $100 sheet of x material. After the
test run then we need to be able set Z=0 again but now at the workpiece
surface so the actual cut can be made.

Z=0 for cutting includes the bit length, it’s a different zero than the machine
going up against the stops (going against the stops is also good for tool
changes)

for setting the soft limits, that’s setting $103 (what you set it to will be
different for different routers)

David Lang

1 Like

My two uneducated cents.

I think we need two z values stored to apply z limits in the software without using actual limit switches.

First the “real z” would be the known distance of travel on the maslow itself.

Second the “cutting z” would be the zeroed point with bit installed (hopefully with the auto z firmware added, like maslow Classic, metal ruler works amazing)

Tracking the two would allow software limits.

Example. Let’s say the “real z” travel is 0-30 cm (I don’t have a maslow 4
yet, so guessimating) 0 when the sled is bottomed out and 30 when it is at the
very top. This could also be used for any changes in belt geometry equations
and would be used as software limits of travel, as the numbers would never
change.

it’s 0-60mm roughly

Zero the machine with a 5 cm bit installed. The “cutting zero” would be zero, but the real zero would be at the 5 cm measurement. This would apply limits at -5 cm depth of cut as it puts the “real z” at 0.

This just sounds the easiest way of doing things with my limited knowledge. Ready for the heavy criticism. :slight_smile:

you are completely correct.

David Lang

2 Likes

Well damn, I’m gonna tell the wife I’m smarter than I look. Know nothing about coding, just made sense in my mind.

3 Likes

If we need to square the Z and the only way to do it is pushing down then perhaps that can be a separate UI function to square it?

Another homing routine:

while raising the bit

 - poll UI for user to make an assertion that it reached home "press any key when at top" 

 - if user confirms end the homing cycle 

 - if no confirmation before timer elapses assume it reached home

 - Let the value of Z change during the movement home and its value is whatever it is when it lands 
  at the machine's mechanical home. 

So we could have four functions

Home Z

Zero Z

Goto Z

Square Z


One consideration, regardless if we home up or home down we may run into challenges from lack of limit switches. Specifically in the software calculation of Z. Is Z tracking going to get fuzzed and distorted when we ram into the mechanical limits?

2 Likes

Zeroing the Z axis, and zeroing the cutter’s Z are very different.

As I understand it, the initial issue raised in this thread was accounting for the Z offset between each of the belt spools and the associated anchor.

  • The offset between the spools themselves can be assumed to be known.

  • By assumed design, all of the anchors lie on the same plane. (There have been various discussions about offsetting them, but these seem all to be driven by a lack of compensation for the belts’ angles.)

  • The user could be expected to provide an offset from the plane on which the anchors lie (the work surface of the frame) and the bottom of the sled- this would be the total thickness of anything stacked on work surface under the sled- typically the sum of the spoil board and workpiece.

The leaves the distance from the bottom of the sled to one of the spools- which varies with the movement of the Z axis of the M4.

If the Z axis were zeroed with no bit, such that the Z axis can bottom out at the lower end of its travel, this distance can be known from the specifications of M4’s components. Unfortunately, unlike the gear motors that drive the spools, I do not believe that there is current sensing on the steppers that could automatically detect when this limit is reached.

If a bit is installed, then it is likely that the Z axis cannot be run all the way down, so this final value is essentially arbitrary.

So- what if there were a way to make an make a measurement to an arbitrary but known point on the moving Z carriage?

Well, here are some handy, unused mounting points on the sled. (And a little foreshadowing…)

Now if you attached a vertical scale to the sled using these mounting points, and a pointer to the Z carriage- say using the three screws that hold the jackscrew nut into the bottom of the post- maybe you end up with something like this-

OK, that’s a cut off wire tie on the post and the scale is just sitting on the sled’s ribs- but the concept is the same.

We now have an offset from the bottom of the sled to a known point on the moving Z carriage and from there to the spools- the final piece of the equation.

The user would have to read and enter this value, and enter the thickness of the spoil board and workpiece. A certain degree of inaccuracy would be inevitable, but would have a vanishingly small effect.

1 Like

setting Z = physical 0 is the same as squaring the Z

but I agree that different functions need different buttons

David Lang

2 Likes

C Peter Lotz wrote:

Zeroing the Z axis, and zeroing the cutter’s Z are very different.

As I understand it, the initial issue raised in this thread was accounting for the Z offset between each of the belt spools and the associated anchor.

  • The offset between the spools themselves can be assumed to be known.

  • By assumed design, all of the anchors lie on the same plane. (There have been various discussions about offsetting them, but these seem all to be driven by a lack of compensation for the belts’ angles.)

No, the maslow.yaml file has a separate entry for each belt, it does not assume
they are all on the same plane.

  • The user could be expected to provide an offset from the plane on which the anchors lie (the work surface of the frame) and the bottom of the sled- this would be the total thickness of anything stacked on work surface under the sled- typically the sum of the spoil board and workpiece.

or an offset from the surface that was used for calibration.

The leaves the distance from the bottom of the sled to one of the spools- which varies with the movement of the Z axis of the M4.

If the Z axis were zeroed with no bit, such that the Z axis can bottom out at
the lower end of its travel, this distance can be known from the
specifications of M4’s components. Unfortunately, unlike the gear motors that
drive the spools, I do not believe that there is current sensing on the
steppers that could automatically detect when this limit is reached.

I think the stepper drivers do detect missed steps (i.e. when it hits the
limits), but if you just drive them for ~60mm you know you have bottomed them
out.

If a bit is installed, then it is likely that the Z axis cannot be run all the way down, so this final value is essentially arbitrary.

So- what if there were a way to make an make a measurement to an arbitrary but known point on the moving Z carriage?

Well, here are some handy, unused mounting points on the sled. (And a little foreshadowing…)

Now if you attached a vertical scale to the sled using these mounting points, and a pointer to the Z carriage- say using the three screws that hold the jackscrew nut into the bottom of the post- maybe you end up with something like this-

OK, that’s a cut off wire tie on the post and the scale is just sitting on the sled’s ribs- but the concept is the same.

how precise do you want to be? the Z axis can do something around 0.01mm

We now have an offset from the bottom of the sled to a known point on the moving Z carriage- the final piece of the equation.

I’m missing what we gained by this over the current method of bottoming out to
get a known position and then adjusting from there.

David Lang

2 Likes

@dlang I don’t (and wouldn’t) disagree with anything you say- I have too much respect for you… but just to be contrarian (and to prove that I’ll fight harder for a bad idea I’ve had than a good idea someone else had :laughing:)-

And sorry, no drawings, not an option at the moment.

This thread started with

I’m not going to second guess his intent, but the specific issue I’m trying to address is not zeroing the Z axis per se, but rather to find the Z offsets between the belts’ anchors and spools, in order to calculate and account for the effect on the belts’ length

Completely agree- - but as far as I can recall, every discussion about shifting the Z position of the anchors has been in the context of increasing accuracy by reducing or eliminating the effect on the belts’ length, and there have in fact been discussions about the advantages of having a down angle on the belts.

In order to be used to provide the needed compensation of the belt lengths, the measurement has to be correlated to the Z position(s) of the anchor(s).

I’m generally not in favor of intentionally driving mechanisms past hard end stops, but in any case this is only an option when no bit is installed.

This process isn’t an attempt to set the Z height to its ultimate accuracy- that’s for zeroing the bit which is a separate question (conductive contact point to an aux GPOI input, anyone?)- this is to provide a value for compensating for the belts’ Z offset. I would argue that it is unlikely that anchor points are actually coplanar- either with one another or to a parallel plane with the surface of the (likely non-planar) workpiece surface- there’s going to be at least a millimeter or two of unknown for any realistic frame and likely more- and the actual thickness of the spoil board and workpiece are unlikely to match their nominal thickness nor be entirely consistent across their entire surface. So the Z offset between the anchors and sled at any point are going to be knowable only to a matter of multiple millimeters. And these factors are going to affect any system, regardless of the way the Z height is measured or calculated.

So what’s the effect of the accuracy of this Z offset on the compensation?

The closer the X/Y distance between the anchor and the end of the spool’s arm, the greater the effect of the Z offset. So the worst case would be when the sled is at the corner of the workspace, for the belt to the immediately adjacent anchor. Furthermore, the effect is always most pronounced on the uppermost spool. These two factors combined create the greatest slope of the belt and thus the greatest offset to be compensated.

Starting with some intentionally rough numbers-

  • For the standard frame, the X/Y distance from the corner of the workspace to the adjacent anchor is about 615mm.

  • I’m not going to take my M4 apart at the moment, but it looks like the distance from the center of rotation of the router to the end of the arm is 125mm and the distance from the center of the anchor to the end of the belt end is 30mm. These two sections remain horizontal, so the diagonal section of the belt is 155mm less, or 460mm.

  • Let’s sat the center Z height of the belt end is 20mm from the surface of the gusset, which is coplanar with the worksurface. On top of the worksurface is a 12mm spoil board and a 19mm workpiece- so, so far we have a net Z offset of 11mm.

  • With the Z axis all the way down, it looks like the center of the top spool is 102mm from the bottom of the sled. So a total Z offset of 113mm.

So the diagonal section of the belt travels a horizontal (X/Y) distance of 615mm and a vertical distance of 113mm- a little Pythagoras later and the length of the diagonal section is 476.676mm. (Yes, I can’t claim that degree of actual accuracy based on the rough inputs- but I’ll just use this to show the effect of changes.) Add back in the two horizontal sections and the belt length would be 628.676mm- that’s 14mm more than the direct X/Y distance of 615- slightly more than 2%.

Let’s say the scale above is only accurate within +/-2mm - which I think is conservative- and likely exceeded by other uncontrolled factors such as the actual thickness of the spoil board and workpiece and how coplanar the anchors actually are.

  • A vertical offset of 115 instead of 113 would result in a belt length of 629.157- a delta of .481mm.
  • A vertical offset of 111 instead of 113 would result in a belt length of 629.157- a delta of .473mm.

In the worst-case scenario, the results are 4x times as accurate as the input value.

Whew.

And finally, Thank You @dlang for all you contribute to the community- I mean that sincerely.

2 Likes

C Peter Lotz wrote:

@dlang I don’t (and wouldn’t) disagree with anything you say-

disagree away, I’ve been wrong before and will be wrong again.

And sorry, no drawings, not an option at the moment.

This thread started with

I’m not going to second guess his intent, but the specific issue I’m trying to
address is not zeroing the Z axis per se, but rather to find the Z offsets
between the belts’ anchors and spools, in order to calculate and account for
the effect on the belts’ length

the calculation used in the code is:
belt_length = sqrt(x_offset^2+y_offset^2+z_offset^2)

so the math is taking the z offset for that belt into account. due to the
shallow angle, there isn’t a lot of effect of including the z offset, but there
is some (when x and y offsets are a minimum of around600 and going up over
3000, a z offset in the tens of mm to about 100mm isn’t changing the belt length
much)

Completely agree- - but as far as I can recall, every discussion about
shifting the Z position of the anchors has been in the context of increasing
accuracy by reducing or eliminating the effect on the belts’ length, and there
have in fact been discussions about the advantages of having a down angle on
the belts.

I’m actually more interested in avoiding tipping forces on the sled actually.

but during calibration, where it assumes that Z=0, if it isn’t, that will throw
error into the calculations.

In order to be used to provide the needed compensation of the belt lengths, the measurement has to be correlated to the Z position(s) of the anchor(s).

I was thinking that if you calibrate on a bare floor, and then add a inch or two
of material when you cut (fasterners, spoilboard, workpiece) then the machine
won’t feed out as much belt as it needs to as it doesn’t know about the extra Z
height.

does it matter? don’t know, it does add extra tension to the belts (and therefor
extra pull-down force, which results in more friction)

I’m generally not in favor of intentionally driving mechanisms past hard end stops, but in any case this is only an option when no bit is installed.

I generally agree, but the stepper drivers are designed to do this, their term
is ‘sensorless homing’

This process isn’t an attempt to set the Z height to its ultimate accuracy-
that’s for zeroing the bit which is a separate question (conductive contact
point to an aux GPOI input, anyone?)- this is to provide a value for
compensating for the belts’ Z offset. I would argue that it is unlikely that
anchor points are actually coplanar- either with one another or to a parallel
plane with the surface of the (likely non-planar) workpiece surface- there’s
going to be at least a millimeter or two of unknown for any realistic frame
and likely more- and the actual thickness of the spoil board and workpiece are
unlikely to match their nominal thickness nor be entirely consistent across
their entire surface. So the Z offset between the anchors and sled at any
point are going to be knowable only to a matter of multiple millimeters. And
these factors are going to affect any system, regardless of the way the Z
height is measured or calculated.

So what’s the effect of the accuracy of this Z offset on the compensation?

The closer the X/Y distance between the anchor and the end of the spool’s arm,
the greater the effect of the Z offset. So the worst case would be when the
sled is at the corner of the workspace, for the belt to the immediately
adjacent anchor. Furthermore, the effect is always most pronounced on the
uppermost spool. These two factors combined create the greatest slope of the
belt and thus the greatest offset to be compensated.

Starting with some intentionally rough numbers-

  • For the standard frame, the X/Y distance from the corner of the workspace to the adjacent anchor is about 615mm.

  • I’m not going to take my M4 apart at the moment, but it looks like the distance from the center of rotation of the router to the end of the arm is 125mm and the distance from the center of the anchor to the end of the belt end is 30mm. These two sections remain horizontal, so the diagonal section of the belt is 155mm less, or 460mm.

good guess, the hard-coded values are 123mm and 30mm in the code

  • Let’s sat the center Z height of the belt end is 20mm from the surface of
    the gusset, which is coplanar with the worksurface. On top of the worksurface
    is a 12mm spoil board and a 19mm workpiece- so, so far we have a net Z offset
    of 11mm.

  • With the Z axis all the way down, it looks like the center of the top spool
    is 102mm from the bottom of the sled. So a total Z offset of 113mm.

So the diagonal section of the belt travels a horizontal (X/Y) distance of
615mm and a vertical distance of 113mm- a little Pythagoras later and the
length of the diagonal section is 476.676mm. (Yes, I can’t claim that degree
of actual accuracy based on the rough inputs- but I’ll just use this to show
the effect of changes.) Add back in the two horizontal sections and the belt
length would be 628.676mm- that’s 14mm more than the direct X/Y distance of
615- slightly more than 2%.

I’m not following your math precisely, but you have the right idea.

the other thing to worry about is that you are pulling down on the end of the
arm, how much force is that? how steep the angle? and will that break the arm?

Let’s say the scale above is only accurate within +/-2mm - which I think is
conservative- and likely exceeded by other uncontrolled factors such as the
actual thickness of the spoil board and workpiece and how coplanar the anchors
actually are.

  • A vertical offset of 115 instead of 113 would result in a belt length of 629.157- a delta of .481mm.
  • A vertical offset of 111 instead of 113 would result in a belt length of 629.157- a delta of .473mm.

In the worst-case scenario, the results are 4x times as accurate as the input value.

the default z offsets are:

Maslow_tlZ: 144
Maslow_trZ: 97
Maslow_blZ: 75
Maslow_brZ: 117

so you are really only talking about the added distance of the workpiece, which
is typically under 20mm

but if you calibrate with the Z all the way down, the system knows the Z height
(assuming it’s properly tracking system Z compared to bit Z, I’ll need to check
the code) and that will be far more precise than your pointer.

David Lang

2 Likes

So my hour long commute (each way) always gives me plenty of time to think, and this evening I’ve identified a blind spot of mine-

  • I’m assuming I need to be able to “zero” the Z axis with a bit installed.

Although I already owned a couple Maslow type machines, I have more actual time using gantry style CNC routers- I’ve owned several. All but one cheap one I was given had X and Y homing switches, but only one had a switch on the Z carriage itself, and that was actually a high limit that was not even read in the homing sequence I used.

Homing the Z has always been a matter of zeroing to the tool tip- either manually or with a conductive pad. Furthermore, I have tendency to leave a bit in the spindle all the time- I typically only remove them when they need to be changed. Lastly, while I really like the idea of the current Z position being retained between sessions- and I think it would be more than accurate most of the time- the fact that the M4 is handled by literally picking it up by the Z carriage makes me want to reverify that Z axis on startup- likely with a bit already installed.

Having said all that- a process whereby an absolute Z zero is determined by driving the Z carriage all the way down with no bit installed seems IMHO like an excellent base functionality.

2 Likes

Workpiece and spoil board combined, I think- often more than 20mm.

When it comes to calculating the Z offset’s effect on the belt length, if we’re not going to use as accurate an offset as possible for everything under the sled, what difference does it make if we accurately measure the Z carriage height above the sled?

1 Like