Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Skew Correction #8624

Merged

Conversation

thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Dec 2, 2017

Based on #8623, #8204 by @Paciente8159


Concise Diff

Machine skew in the XY, XZ and YZ planes can be adjusted with command M852 I J K command.
Values are stored in EEPROM.

This is a re-commit of #8159 with the changes suggested by @Allted and additional mangling by @thinkyhead.
This addresses issue #3839 and #5116.

@thinkyhead thinkyhead force-pushed the bf2_skew_correction branch 3 times, most recently from 286664e to 7dd0bb5 Compare December 2, 2017 01:33
@thinkyhead thinkyhead merged commit 98aba6a into MarlinFirmware:bugfix-2.0.x Dec 2, 2017
@thinkyhead thinkyhead deleted the bf2_skew_correction branch December 2, 2017 06:43
@CCS86
Copy link

CCS86 commented Dec 18, 2017

Is there a discussion somewhere about the best ways to determine the skew values?

@thinkyhead
Copy link
Member Author

@CCS86 The exact way to determine the skew values is documented in the configuration file. You just print a square, take some measurements, and input them as your side lengths.

/**
 * Bed Skew Compensation
 *
 * This feature corrects for misalignment in the XYZ axes.
 *
 * Take the following steps to get the bed skew in the XY plane:
 *  1. Print a test square (e.g., https://www.thingiverse.com/thing:2563185)
 *  2. For XY_DIAG_AC measure the diagonal A to C
 *  3. For XY_DIAG_BD measure the diagonal B to D
 *  4. For XY_SIDE_AD measure the edge A to D
 *
 * Marlin automatically computes skew factors from these measurements.
 * Skew factors may also be computed and set manually:
 *
 *  - Compute AB     : SQRT(2*AC*AC+2*BD*BD-4*AD*AD)/2
 *  - XY_SKEW_FACTOR : TAN(PI/2-ACOS((AC*AC-AB*AB-AD*AD)/(2*AB*AD)))
 *
 * If desired, follow the same procedure for XZ and YZ.
 * Use these diagrams for reference:
 *
 *    Y                     Z                     Z
 *    ^     B-------C       ^     B-------C       ^     B-------C
 *    |    /       /        |    /       /        |    /       /
 *    |   /       /         |   /       /         |   /       /
 *    |  A-------D          |  A-------D          |  A-------D
 *    +-------------->X     +-------------->X     +-------------->Y
 *     XY_SKEW_FACTOR        XZ_SKEW_FACTOR        YZ_SKEW_FACTOR
 */

@CCS86
Copy link

CCS86 commented Dec 20, 2017

Doh! How did I miss that? hahaha

Thank you @thinkyhead

@CCS86
Copy link

CCS86 commented Dec 25, 2017

In case anyone is interested, I modeled my own calibration square. I saw some areas to improve over the one linked:

  • To avoid a bottom lip that needed to be carefully removed, I added a blended chamfer.

  • I liked the planar faces for the diagonal measurement, but didn't like that there was such a sharp transition leading into them. I could see a ripple in that face, even when printing outer walls at low speed / acceleration. I added a large tangent arc as a lead in to that face.

  • I also added a little peak on the Y+ side. This is helpful in getting the slicer to align the seams there.

I print it in Cura 3.1 with no bottom or top layers, 35% density triangular infill, 8 perimeter laps, a brim, and 25 mm/s outer wall speed:

image

Model:
Calibration Square.stl.txt

@thinkyhead
Copy link
Member Author

Nice work! Is it essentially more sturdy, easier to measure from corner to corner, and so on? We should include it in the Marlin package with any other test/calibration G-code we think would help get settings dialed in (and to stress-test things like feedrate, acceleration, direction-changes, braking, etc.).

@CCS86
Copy link

CCS86 commented Jan 26, 2018

Feel free to include it.

I also made a model for testing motion settings / planner throughput, that has been helpful. I print it as a spiral vase at different speeds/acceleration/jerk combinations:

image

MT3.stl.txt

@thinkyhead
Copy link
Member Author

Wow, that is great, and a work of art besides.

As it happens we're in a total testing/debugging mode right now with Marlin, including adding more stress-tests like these for both developers to check code and end-users to check settings. I just started a MarlinTest.gcode script with just the most basic moves being tested so far. Even the most basic moves can expose bugs, such as the current (ridiculous!) last-move-not-joined bug.

The script uses M1 to put a prompt on the screen for each test, plus M118 to print headings to the console, and M114 D1 to print extra-detailed position reports (needs M114_DETAIL enabled). Later I'll put some of tests in a DEBUG menu that will also do internal and guided testing of Marlin and the machine to make sure everything is functioning properly. (Too many bug reports where users have a bad component.)

So, anyway, please contribute more ideas and tests! We'll be happy to use them and make them part of the test suite.

@CCS86
Copy link

CCS86 commented Jan 27, 2018

Very cool. I think my thread here could be of some help in the testing/tuning:

#9219

@Roxy-3D
Copy link
Member

Roxy-3D commented Jan 29, 2018

So, anyway, please contribute more ideas and tests! We'll be happy to use them and make them part of the test suite.

Would it be appropriate to add a few line drawing GCodes to help test the linear advance stuff? It might be helpful for the people that use that if there was a standardized test. Maybe something that can draw a small sub-section of this pattern:

#9142 (comment)

@thinkyhead
Copy link
Member Author

Would it be appropriate to add a few line drawing GCodes to help test the linear advance stuff? It might be helpful for the people that use that if there was a standardized test. Maybe something that can draw a small sub-section of this pattern:

There is such a test posted somewhere on the internets. Or, a script that generates the test G-code. We could include that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants