Skew compensation in the Bambu X1C Firmware

@Giovanny Yes, I have the same result. M500 does not retain the setting when the printer is powered off…

In the instruction pdf for the M1005 gcode from Bambu tech support they say:

‘Add M500 save to the next line, so that the compensation value is still present after restart.’

But I just had my X1C powered off to fix a jammed extruder and the compensation value was lost.

as a ‘fix’ for this you could use the M1005 [In] format of the command and leave it as a permanent addition to your start gcode

please paste the gcode you used here

M1005 X79.37 Y79.55
M1005 X79.62 Y79.51
M1005 X79.46 Y79.67
M1005 X79.52 Y79.60

this is the numbers that I was measuring each time and the full gcode that i used. each line was a print and only one line was used.

According to the instruction PDF you need to follow with M500 to save the values.

2 Likes

I did M500 every time, just didn’t list in above.

For the people whose printer loses the value, do you have an micro SD card in the printer?

@Giovanny @EdStreet @klomar

yes have a sdcard in the printer

@EdStreet The skews from your 4 sets of measurements are about:

-0.13, 0.08, -0.15, -0.06 degrees.

So you are changing the skew with M1005.

It’s quite hard to accurately measure to hundredths of a millimeter on the surface of a 3D print.

0.06 degrees skew is about 0.27mm across the width of the print bed but you should be able to improve that with careful measurements.

The M1005 [Xn] [Yn] format, where you can keep applying a new compensation value to the previous one, can make the result bounce around a lot when you get close to 0 degrees, unless your measurements are very accurate.

I prefer to use the M1005 [In] format (see details in my previous post above).

1 Like

@SimEyeSee Yes, I have an SD card in the printer.

Here’s a method that gets round the problem of the skew compensation value not being retained when the printer is powered off:

From repeated measurements of test prints I have calculated that the skew in the XY geometry of my Bambu X1C is -0.003594 radians (-0.20592 degrees). The method of calculating this skew factor is detailed in my post headed M1005 [In] (see above).

To correct this I apply the -ve of the skew factor (in radians) as a correction factor with gcode M1005 using the [In] parameter:

M1005 I0.003594

I’ve added this gcode (as a permanent addition) at the end of the Machine start G-code so the correction is applied for every print, including when the printer has been powered off and restarted.

To the limits of my printer’s accuracy and the accuracy of my measurements this brings my XY skew down to about -0.005 degrees, 2.4% of the original skew. Over the width of the print bed that would equate to an error of only 0.02mm.

The M1005 [In] format of the command doesn’t iteratively apply a new compensation value to the previous one, like the M1005 [Xn] [Yn] format does. So every print will just have the same correction factor applied.

I don’t include M500 after the M1005 [In] command in the Machine start G-code because:

a) It doesn’t work to retain the setting ‘after restart’.
b) It might be repeatedly updating non-volatile memory on one of the X1C controller boards which might reduce its lifespan so it seems safer to exclude it until we understand how M500 has been implemented in the Bambu Lab firmware.

@Giovanny @SimEyeSee @Nebur

5 Likes

It’s been many years since I’ve done math problems like that. Any chance you can give an example with some numbers plugged in? Maybe I can understand it then :upside_down_face:

1 Like

Ok, I’ll do that soon :slightly_smiling_face:

1 Like

M1005 X79.88 Y80.42

I’m not good at math
Can you help me calculate my data?
Or there is simple automatic calculation software
Thanks!!

Thanks for all your work to figure this out

1 Like

I was watching the youtuber matthiasWandel, and he made the comment that having your angles off by even just a little bit can be a noteworthy problem when printing gears that need to mesh together. So, reducing the skew for such things may well make a noticeable difference.

2 Likes

Here’s a link to a spreadsheet you can use to calculate the skew factor and generate the gcode to apply the correction factor:

Skew Calculator

It has some sample data in the GREEN boxes. Overwrite that with your measurements AC, BD and AD. Don’t overwrite any of the formulas in the other boxes.

The measurements should be from a test print that shows the uncorrected skew of your printer. If you’ve already applied a skew correction factor reset it with gcode M1005 I0 before printing the test.


If that doesn’t work for you then here’s an example of the calculations with some numbers plugged in:

Y
^     B-------C
|    /       /
|   /       /
|  A-------D
+-------------->X
XY skew factor
AC = 79.95
BD = 79.61
AD = 56.34

Calculate AB from AC, BD and AD:

AB = SQRT(2*79.95^2+2*79.61^2-4*56.34^2)/2
   = 56.486

Calculate the skew_factor from AC, AD and AB:

skew_factor = TAN(PI()/2-ACOS((79.95^2-56.486^2-56.34^2)/(2*56.486*56.34)))
            = -0.004262 radians

Apply the -ve of the skew factor as the correction factor with gcode M1005 [In]:

M1005 I0.004262


If you want me to calculate the correction factor for you, or to check your cakculation before you apply it with gcode M1005, then post your measurements from the test print here. I need the measurements AC, BD and AD.

@Giovanny you’ve alrady posted AC as 79.88 and BD as 80.42. Can you also measure AD and post it here?


@lindnjoe @Giovanny

4 Likes

@NeverDie I was designing boxes with hinged lids but the front of the lids didn’t line up with the front of the boxes because the XY geometry of my printer was skewed. I didn’t like some of the solutions suggested online that involved adjusting the printer’s geometry with shims or belt tension when skew should be compensated in firmware. I hope Bambu Lab will extend the functionality of gcode M1005 to include XZ and YZ compensation.

1 Like

I measure the objects printed by the STL in the PDF file to measure X and Y
But I don’t know how the AD distance should be measured

@Giovanny Measure it here:

I calculate it with the excel provided by you
AC159.50 BD160.50 AD113.04
I0.006250
Thanks

1 Like