Thursday, November 1, 2018

Adjusting for X/Y Skew in your Slicer

I have had a minor annoyance with my 3D printer that it skews the print in the X/Y place and will print a cube as a bit of a parallelogram instead. This is not that the X or Y are misaligned, the sizing is consistent, there is just a skew. After some research I found a solution in the slicer instead of manual tweaking the frame or flashing the firmware.

To be sure I could have flashed the firmware with a recent Marlin firmware, but that required extensive knowledge of the parts and configuration values, testing, and in my case an Arduino as well witch I don't have. I tried messing with the frame and rods a bit but couldn't find any noticeable defects and everything mounted quite securely without much adjustability.

Then I stumbled upon this Cura plugin that clams to make the corrections in a Post Processing script. I was a bit skeptical but I tried it out and two tests latter I had it printing perfect cubes.

Determine if you have a skew:

Print this calibration model. You can safely print it at  high speed with .2mm layers and still get good adjustment values. I also scaled the Z down to speed it up, but print the full 100mm X/Y. 

When done first measure the X at multiple points and the Y at multiple points to ensure that all measurements are 100mm and you don't have stepper, rod alignment, or other issues. Those issues are not covered here but would need to be corrected first.

Finally measure the diagonal form A to C and compare it to B to D. Record the numbers and decide if you need skew correction. In my case on a 100mm test by AC and DB were off by around 1.8mm which was noticeable on compartments and trays I printed for board games.

To correct the skew:

First download the SkewCompensation.py script for Cura from this project by joochung.  You will need to install it in Cura's scripts folder. Open Cura and go to Help -> Show Configuration Folder and drop it in the scripts folder there. You will then need to restart Cura once.

Now calculate the skew angle but using the Excel file that is included on the project. The formula is rather complex so just open the 3D_Printer_Axis_Calibration.xlsx file and fill in your AC and BD measurements in cells C13 and C14. Cell C18 should then have a decimal result less then .05. Record this number as it's your Skew Adjustment and what you will enter in Cura. If your skew is more then that I'd look into physical issues and adjustments.

Now, back in Cura click on Extensions -> Post Processing -> Modify G-Code. In the dialog select Add a script -> Skew Compensation. On the right side change XY Type to Tangent and enter the skew adjustment you calculated in the XY Tangent field.

Close this dialog and print the calibration model again and re-measure. If you swap the AC and BD measurements that the box will be more skewed not less. I was able to get a perfect box on the first try.

4 comments:

Shaban said...

Oho finally found it. I need to send this to my friend with a 3d printer. She stopped making things cuz of this.

https://aab-edu.net/

Anthonyd said...

How do you know how to orient the vertical calibration objects? The vertical ones could be oriented in either of two ways. They are not labelled. I will have to experiment, probably I will have to try both ways. The xz one has an intuitive orientation, with the markings facing the user. However, the zy one could have the markings facing left or right, either is just as sensible.

Anthonyd said...

This whole proceedure and software is GARBAGE. I spent days trying to get things working, print after print, garbage. I eventually opened up the gcode files and looked at things. The plugin does not actually change the y values! It changes the x values by a fixed amount, and the wrong amount! It changes them the same amount no matter what the correction factor is.

It also causes serious errors sometimes, that look like large missed steps in the model.

Total garbage. I wouldn't be so upset, but there is nothing else, instead! There is an attempt, mechanizedmedic, but it doesn't work, it just gives an error message.

The *only* way to correct for skew in the ender 3 is to upgrade the firmware to marlin 2.0 and use M852 or build the correction factors into the firmware.

R.L. said...

This procedure worked for me. Big improvement on first try. Thank you for posting the instructions and links.

-Rob