Feature Request : Z leadscrew mapping

Hello all.

I’ve been fighting a Z-Banding problem in one of my 3d printers for some time. I’ve swapped lead screws and nuts, added many types of Z isolation, motors, alignment, but I always end up in the same place, banding.

It occured to me that there are likely 2 causes that are leadscrew related.

  1. Leadscrew Warp.
  2. Inaccuracies in the threads on the leadscrews or nuts.

To test the positional accuracy (#2) of the leadscrews I fashioned a crude caliper that measures the height of the X gantry at any point in the Z travel. Like others my banding seems to happen with a full rotation of the leadscrew. And using my crude measuring device I can see real positional errors at multiples of 8mm (4 start 8mm screws). I’m seeing up to .06mm-.09mm errors in the position that the gantry is, vs where its commanded to goto. I’m in the process of setting up a DRO with glass scales to mount rigidly to the gantry to provide a more confident test. This DRO has a usb connection so the values displayed in the DRO screen can also be read programatically.

— Feature Request —
I propose a new feature that acts similar to ABL that maps the actual position of a leadscrew(s) vs the commanded position. So, if the Z axis was sent to 20mm, and the measured position was 19.82mm Klipper would command the axis to 20.18. The DRO could be used programatically to determine the actual position of the gantry to build the map. This could be a command (z_leadscrew_map) to create a 1 time map and you remove the DRO and glass scales after the map has been made. If banding occurs in the future the DRO could be reinstalled to build a current map.

Thank you for your consideration,
Scott…

1 Like

Update:

I have a DRO mounted and am trying to test my theory, but I believe that my current mounting process is causing the observed results to change from actuals had the device not been installed. i.e. there is friction in the DRO scale, and possible flex in my printed adapter that connects the DRO scale to the X axis gantry. The friction is causing the gantry to flex. The friction also possibly causes the adapter to flex although it should spring back. I think if I can get the adapter closer to the leadscrew then there will be less flex in the gantry. Didnt expect this one. I’ll report back when I have something that works better. Seems like a classic case of Observer Effect :slight_smile:

I had grand plans to manually create a map that maps the physical (actual) position of the Z axis vs the commanded distance to move. Then collect this data for every .2mm from 0-20mm in the Z axis. I was going to create g-code for a 20mm cube, and modify the Z movements to the positions from the map that get the actual height to the desired height, to see the impact on Z banding.

We do exactly what you’re trying to do in the industrial world. We call it distance compensation and we use a laser interferometer to measure the inaccuracies of the lead screw, rack and pinion, etc.

Unfortunately interferometers cost tens of thousands of dollars used and they require yearly calibration/certification. So that’s not exactly practical for the hobby user. If you’re savvy enough, it’s entirely possible to build your own interferometer. However, still have to deal with the calibration to an accurate standard problem.

As far as the compensation for the bow of your linear travel. We also do that in the industrial world and we call it sag compensation. You can have said compensation for the same axis in multiple planes. So say your x-axis is bowed in the y and the Z direction you can compensate for that. You first measure one direction and make a compensation table for it and then you measure the second direction and compensation table for it. The control then combines the two compensation tables to give you an interpolated straight axis.

Sag compensation can also be used for machines that only have a single Z column. One example would be a polar 3D printer. As the printhead moves farther away from the z-axis The weight of it bows linear guide. You can use side compensation to correct for the weight and bow as the head moves farther away from z-axis column.

We use a different type of laser for sag compensation that is a highly accurate laser level. These can measure flatness within 0.0025 mm/m in a 360° plane. You can also use precision reflectors to change the laser plane by 90° to make sure that your machine is square. These lasers cost upwards of $100k, so again not practical for hobby users.

I think integrating both distance and sag compensation into Klipper would be amazing, but we are going to have to come up with a way to accurately measure the inaccuracies that is affordable for the average user.

Sometimes it is really funny to read about such concepts and expectations but to be honest, I’m kind of in the same boat:

  • Printer frame with 2040 (at best) profiles and 1 USD extrusion brackets is already considered precisely aligned and rigid
  • Linear motion components in the Ali Express range of below 10 USD are also already considered almost overdone
  • Open loop standard steppers are the way to go
  • Rest of the printer is hold together by self printed parts made of PLA

Derived expectancy: Accuracy and repeatability below 0.01 mm and if this does not work out, the firmware has to magically fix this by relying on measurement with the accuracy of +/- 0.5 mm

Ugly reality: A single Class 0 or 1 ball-screw already costs a multiple of most of the printers around (or my car for that matter) not speaking of the rest of the needed components

You are exactly right. I have this discussion with my customers every time they ask about retrofitting a CNC machine. Electronics cannot fix your mechanical inaccuracies. If you have a machine that is not straight and flat I can’t reliably fix that with electronics. It must be fixed mechanically.

Now that being said, once your machine is as flat straight as it can get, we can increase the overall accuracy of the machine using electronics by doing these complex compensations. These compensations have to be checked periodically in order to ensure that the machine remains accurate.

If you just use electronics to compensate for mechanical failings, the machines are not repeatable and it can induce a lot of unexpected behavior leading to problems with overall machine accuracy.

If you want a more accurate and stable printer, you are way better off spending your time and money upgrading the physical components to make it more rigid, straight and high tolerance.

1 Like

This feature is not that much different than auto bed leveling, and in reality a lot easier to implement. Assuming the accuracy of a lead / ball screw can be measured (which I believe can with glass scales) then this is a simple translation. Not sure why folks think this is crazy to ask for when ABL (mechanical inaccuracy compensation) is widely used and way more complex.

It’s not a crazy idea and it is trivial to implement. The biggest problem with it is actually measuring the inaccuracies of your machine.

A glass scale could work. But they have to be fairly well aligned with the travel of your machine. They don’t generally tolerate a lot of deviation in travel. On a traditional CNC, a glass scale is used as a second measuring device in place of the encoder on the server motor. The scale is used to close the loop and eliminate mechanical and accuracies. Varying quality and accuracy scales can be purchased for a wide range of prices. The trick will be mounting it and then indicating your glass scale in on your machine. You can’t just slap it on there with some bolts and hope for the best. Allowable deviation for mounting a scale is usually less than 0.025 mm ( varies by manufacturer and quality scale). This means that your machine has to be flat and straight by close to that amount in order for the scale to work properly and be accurate.

Bed leveling works so well because it just assumes that the only thing that matters is the flatness of the bed and adjusts the Z height so that nozzle is an equal distant away from the bed in any position. There’s no need for any sort of super close alignment or high tolerance parts. For that. You just need a repeatable motion.

Very new here so please be gentle with the new guy…lol. I do have a fairly well equipped Home Machine Shop and the benefit of 5 years of training with my Dad (Master Tool and Die Maker) before he passed.

Just a suggestion…once you get the printer as straight, flat and rigid as it can be, it seems to me there is a simple way to measure the accuracy of the Z movement, no scales required.

(I’m imperial but I have it on good authority that metric equivalents are out there.) Get a set of three 1-2-3 Blocks and a reasonably priced Digital Drop Indicator. Attach the Indicator to the x-axis rail/extrusion run it up above 9 inches (the height of the 3 blocks stacked on the long axis +/- .003 or so). Zero out the indicator on the top block, remove the top block, lower Z to the next block when the indicator reads “0” you will have completed a 3 inch move +/- .001 or so. Rise and Repeat until you zero out on the bed. You can then repeat using the 2" block dimensions, then the 1" dimensions or any combination there of. This level of repeatable accuracy should be doable I would think for $75 US and likely less.

Very portable setup and can get you very accurate 1" movements over the 9" distance. No need to mess around with scales glass, magnetic or other wise. As others with far more shop experience have already stated it is no easy feat getting DRO equipment properly and accurately mounted. I used this method to verify the Z movement of my Ender 3 MAX within a week of getting it just to see how accurate it was. I was pleasantly surprised. No where near the accuracy of my KO Lee Surface grinder but very respectable. Cannot remember the numbers but no adjustments were required.

I’m here in the Klipper forum because I just completed a Voron 0.1 build and it works!!!

Hope I haven’t made a total fool of myself first post out…lol

Ken O.

Your method would absolutely work to check your machines accuracy. However, lead screw compensation is not used just for accuracy. It is also used for precision. Just because a machine can accurately repeat its position over and over does not mean that that position is precisely 1 in.

Out of the box, all 3D printers are fairly accurate. In order to check your machines precision you would have to use the dial indicator set to zero on the bed then move it up 1in and put your 123 block underneath your indicator and see if it’s still reads zero. Then repeat for the two and three inch dimensions. This will give you an overall idea of the precision of your machine. However, this does not take into account any sort of angularity deviation.

In order to check angularity deviation traditionally and a machine tool, you would use a cylindrical square. Which is a highly precise ground cylinder with ground 90° ends. You can then run your indicator up and down the cylinder in multiple axis directions in order to check if your machine is leaning in any particular direction.

Cylindrical squares aren’t very expensive. You can find smaller ones for $300 to $400. However they are very heavy. I have a 6-in diameter by 12-in tall one and it weighs around 30 to 40 lb. The weight of the cylindrical square would deflect the frame of the printer because they’re not built to handle that kind of weight and would give you inaccurate measurements.

You also need to check the perpendicularity of each axis. You could use your 123 blocks for this as well. You would have to indicate the 123 block straight in one dimension and then run your indicator along the edge of it in the perpendicular direction. For example, indicated straight in X and then move your indicator to the Y side of the block and see how far deviates.

Manual alignments like this are absolutely something users can do at home for minimal amounts of money. The bigger issue here comes in that printers are not built to be adjustable in the methods they need to be in order to align them like this.

After all of these mechanical alignments are done then you You would be able to implement lead screw mapping. Which is just one more method of further removing the inaccuracies of a machine. There is a point of diminishing returns though. Most of the time when I map a lead screw on a large machine, the deviation over one foot is less than 0.002in. Due to the machines that make the screws being accurate and fairly precise, the screws that we put in our machines are also fairly accurate and precise. Especially when you’re talking about 3D printer tolerances.

I knew pretty much everyone here was smarter than me…lol Your points are well taken. However, having a small understanding of how much “mass” plays a role in repeatable movements of precision machine equipment (and understanding subtractive manufacture imparts far more stresses than additive) I still wonder if the level of accuracy being chased is even practical. From what I understand from the discussion I get the impression we’re talking tenths of thousands (.000x), that’s a pretty tight tolerance for a 3D Printer.

That said I’ll also admit up front that as much as the logical side of my brain says “it’s a bridge to far” I’ll likely be right at the front of the line to implement a procedure for doing it when someone comes up with a doable method…lol Just love being as precise as possible.