# Bed compensation algorithm

Posted by kwikius
 Bed compensation algorithm May 25, 2014 03:15PM Registered: 8 years ago Posts: 256
The bed compensation is meant to compensate for an out of true bed. However Even once well off the bed I see the Z rod moving as the head moves about in z and y. I'm not getting that. Surely what should happen ( or at least be one option) is that the printer lays down a screed to fill in and level the bed and then compensation is done? Otherwise all that is happening is that the uneven bed is reflected all the way up the piece of work?

Or am I missing something?

regards
Andy

Ormerod #318
www.zoomworks.org - Free and Open Source Stuff
 Re: Bed compensation algorithm May 25, 2014 03:47PM Registered: 8 years ago Posts: 314
Quote
kwikius
The bed compensation is meant to compensate for an out of true bed. However Even once well off the bed I see the Z rod moving as the head moves about in z and y......
Andy
That's a really interesting question. I had just thought it is a clever bit of programming, but when you asked the question I realised I had no idea!
To work it must surely try to realign the slices?
The more I think about it I really need a level bed!

Ormerod #007 (shaken but not stirred!)
 Re: Bed compensation algorithm May 25, 2014 04:11PM Registered: 8 years ago Posts: 780
I think the idea and the way it works is as follows.

Take an extreme example, the bed is at an angle of 30 degrees but because of the compensation the part should be printed as if the bed is at 0 degrees.
So the error is carried all the way up the part to be printed, so a tall 5 x 5 tower will be printed correctly so all corners are square and the part is at 90 degrees to the bed in all directions.

Hope that helps

appjaws - Core XYUV Duet Ethernet Duex5
firmware 3.1.1 Web Interface 3.1.1
Ormerod 1-converted to laser engraver, Duet wifi
slic3r-1.3.0, Simplify3D 4.1.2, Cura-4.4.1
 Re: Bed compensation algorithm May 25, 2014 04:44PM Registered: 8 years ago Posts: 1,230
Quote
appjaws1
...so a tall 5 x 5 tower will be printed correctly so all corners are square and the part is at 90 degrees to the bed in all directions...

..but a twisted first layer must be carried to the top and that is one of the reasons I don't use the compensation, another is the wear on the z-treaded rod and nut, yet another that it's so easy to adjust the y-axis-end-plates once and for all that it would be silly not to

[forums.reprap.org]

Erik

Edited 1 time(s). Last edit at 05/25/2014 06:14PM by ormerod168.
 Re: Bed compensation algorithm May 26, 2014 04:14AM Registered: 8 years ago Posts: 256
So if as seems to be the case, any lack of flatness in the bed is carried all the way up the part, then one way to solve would be

1) map the bed ( e.g using the Z height sensor or a digital vernier caliper etc),
2) create a Gcode file to screed the bed
3) create a file with the intersection of your screed file and the shape of first layer of the part to be printed, preferably using the "support material " option.
4) print that with bed compensation on,
5) rezero the z sensor, turn off compensation and away you go with the print proper.

Ideally the whole preamble could be prepended to the file to be printed, if the (EDIT) commands to remove compensation and set zero work while a print is running!

Sounds simple enough!

regards
Andy

Edited 1 time(s). Last edit at 05/26/2014 04:16AM by kwikius.

Ormerod #318
www.zoomworks.org - Free and Open Source Stuff
 Re: Bed compensation algorithm May 26, 2014 05:59PM Registered: 8 years ago Posts: 377
The bed compensation would cause a small angle error, where the Z axis isn't quite straight to the X or Y axis. This is sometimes the case even with perfectly level beds, and can be compensated with the M556 command. The angle error from an unlevel bed will probably be very small, it can be quite a bit more from the printer not being entirely straight. Each millimeter of level difference across the bed (over 200mm) is about 0.3 degrees.
 Re: Bed compensation algorithm May 27, 2014 04:44AM Registered: 8 years ago Posts: 19
The bed compensation algorithm translates all the movements in order to (1) make each layer parallel to the bed plane, and (2) preserve the orthogonality of the three axes in the printed object.
As you can see in this video [www.youtube.com] , the column is built tilted, following the tilt of the plane and thus producing a perfect print identical to one you get on a level bed.
 Re: Bed compensation algorithm May 27, 2014 05:44AM Registered: 8 years ago Posts: 256
Quote
aesuli
The bed compensation algorithm translates all the movements in order to (1) make each layer parallel to the bed plane, and (2) preserve the orthogonality of the three axes in the printed object.
As you can see in this video [www.youtube.com] , the column is built tilted, following the tilt of the plane and thus producing a perfect print identical to one you get on a level bed.

Aha .. Thanks for that. A video is worth ... etc .. With bed compensation The whole print is tilted. Simple! It shows that the values you put in will have quite a powerful effect on the print though so I will have to take more care of them in future!

regards
Andy

Ormerod #318
www.zoomworks.org - Free and Open Source Stuff
 Re: Bed compensation algorithm May 27, 2014 06:57AM Registered: 8 years ago Posts: 14,621
Quote
kwikius
With bed compensation The whole print is tilted. Simple!

The whole print is tilted only if you have axis compensation correctly set up as well as bed compensation. If you rebuild the bed and it ends up with a different tilt than before, and you don't re-do the axis compensation, then the whole print will be tilted to match the old bed level, not the new one.

In principle, this could be fixed in firmware. When entering the axis compensation parameters, you would also enter the bed compensation parameters at which the axis compensation was done. Then the firmware could recompute the axis compensation required with the new bed levelling measurements.

If second degree compensation is in effect (e.g. because there is a twist between your y-axis rods), then the bed is in effect not flat, and this can't be compensated for by tilting the print

Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
 Re: Bed compensation algorithm May 27, 2014 03:55PM Registered: 8 years ago Posts: 314
Quote
aesuli
The bed compensation algorithm translates all the movements in order to (1) make each layer parallel to the bed plane, and (2) preserve the orthogonality of the three axes in the printed object.
As you can see in this video [www.youtube.com] , the column is built tilted, following the tilt of the plane and thus producing a perfect print identical to one you get on a level bed.

Amazing video seeing it actually compensating such a huge error, I now understand...

I also like the spiral vase, is a spiral print option available in Slic3r?

Ormerod #007 (shaken but not stirred!)
 Re: Bed compensation algorithm May 27, 2014 04:49PM Registered: 8 years ago Posts: 377
Quote
Treth
I also like the spiral vase, is a spiral print option available in Slic3r?

Yep, it is in Slic3r under Print Settings -> Layers&Perimeters -> Spiral Vase.

It does the perimeter as a continuous spiral (slowly lifting Z all the time) instead of individual layers (with one Z lift each layer). It only works for things that are just one perimeter layer thick though. Haven't had much use for it other than in test/calibration pieces.
 Re: Bed compensation algorithm May 28, 2014 12:07AM Registered: 8 years ago Posts: 256
Quote
dc42
[...]
The whole print is tilted only if you have axis compensation correctly set up as well as bed compensation. t

OK. So bed compensation doesnt by itself tilt the printed part. I could however do a few calculations and then add the needed resulting axis compensation manually.

Thanks for the clarification. On most of my prints its not that critical but nice to know if I need to get super accurate at some point!

regards
Andy

Ormerod #318
www.zoomworks.org - Free and Open Source Stuff
 Re: Bed compensation algorithm May 28, 2014 03:24AM Registered: 8 years ago Posts: 377
The best start for getting an accurate print is to fix things "mechanically" and make sure all axis are close to 90° as they can be (the the X and Z axis can both move about a bit if they aren't tightened properly) and level the bed manually (I got mine on M3 screws to adjust, as do many others here). After that, correct any remaining defects in software.
Sorry, only registered users may post in this forum.