Skew compensation in the Bambu X1C Firmware

:slightly_smiling_face: Ok, Iā€™m testing it nowā€¦

@Nebur @EdStreet

Some interesting (and weird) resuts:

image

So it has applied a scaling factor (correction) to my axes. But I canā€™t find the M290.2 command in my syslog. And at the end of my test print after applying the correcion, my print head collided quite firmly against the endstops. I need to do another print after a restart to check for collisions and to see whether the correction is persistent.

EDIT: for clarity the M290 was applied in my start gcode and the collisions ocurred at the end of my test print.

It should be M292.2 no? Guessing the 290 is a typo?

@EdStreet see this post above and @Nebur 's reply:

The collisions werenā€™t severe (like when I tested extreme skew angles) but it didnā€™t sound right. Iā€™d like to run that again but we donā€™t (yet) have a way to reset the correction if itā€™s persistent. My current test print should check if itā€™s persistent.

@Nebur @EdStreet Here are the results after I power cycled the printer:

image

So the correction isnā€™t persistent. (I did apply M500 after M290.2 in my previous print).

I think Iā€™ll run these tests again and watch carefully for collisions at the end. Iā€™ll also look at syslog again. Then try different sized prints.

The previous print did correct the scaling of my axes. Thatā€™s encouraging.

Has anyone tried for sh!ts to use [M500] in the [Ending gcode] section?

Still havenā€™t loaded up X1Plus and I wonā€™t most likely until we receive the next full firmware version. But remember base marlin having [2] methods of saving to EEPROM. Iā€™m really frustrated at the fact BL hasnā€™t simply released a full wiki of all the codes. . .

Yes, weā€™ve tried that. Bambu have confirmed that itā€™s a bug that they hope to fix in the next version of their firmware.

1 Like

At the risk of sounding rude (not trying to) ā€¦ Have you read the machine gcode sections?

M500 is in there more than once.

Hereā€™s a syslog extract for M290.2:

@Nebur @EdStreet Be careful if youā€™re testing the M290.2 gcode with a test print. I tested it again and it does cause the print head to hit the end stops faster than it normally does. I suspect that the print head normally decelerates when it gets close to where it ā€˜thinksā€™ the end stops are and M290.2 might be throwing that off. Itā€™s not a violent collision, at least not with the small correction I applied.

This really is increasingly frustrating. And I get the feeling itā€™s not so much a decision they have made, but rather a case of no-one having time or being assigned to do it. They likely even have a complete reference, just not in English so itā€™s a matter of (somewhat technical/challenging) translation.

2 Likes

M1009 is a command that does nothing by itself. It appears that itā€™s intended as a sort of wrapper for any Gcode sequence Bambu printers publish to themselves. For example, speed adjustment.

The printer publishes the following:

M1009 L1 O1 M204.2 K1 M220 K1 M73.2 R1 M1002 set_gcode_claim_speed 5 M1009 L1 O1

Whereas we send every part of that sequence except M1009 L1 O1. There is no callback or setting associated with M1009, so my educated guess is itā€™s used to ensure the message can always be parsed. The beginning and end of the string can be chopped off without invalidating the command(s)

I am working on a Wiki page for this, but if you would like to see other undocumented Gccode commands, see this commit of mine: gcodegenerator.js

Could you please provide the full path to the syslog where you are finding these extracts?

Iā€™m SSHing into X1+ via MobaXterm and none of the logs I can find include anything like the extracts - no M codes, no ā€œinfo forwardā€ lines, etc.

/tmp/syslog.log. Itā€™s a rotating log file so just ignore the numbered files for now.

Bambuā€™s log path is /userdata/log/syslog/syslog.log, but you wonā€™t see much activity there since you installed x1plus

Thanks, found it. Wouldā€™ve sworn I looked there beforeā€¦

Having encountered the skewness issue some time ago I thought of a method to deal with it which I have not yet read in this conversation. Though I did not read each and every post.

  • Since the scale of the X and Y axes is dictated by the timing belts they are fundamentally equal
  • When printing a square with skew axes, the result wil become a rhombus
  • A fundamental property of a rhombus is that the diagonals are orthogonal

So, when rotating the print object over 45 degrees the result will be very close to rectangular. Strictly, the rotation needs to be 45 degrees minus half the skewness angle.
This comes at the cost of the original X and Y sides not being exactly equal any more.
If needed, in bambu studio X and Y can be scaled independently and X and Y scaling is preserved during rotation of the object.
Drawbacks:

  • the size of the object is limited to roughly 70% (square root of 2) divided by 2
  • the infill must be rotated as well

I have not tested this yet!

Hi @olxs

Iā€™m not sure what you mean. Perhaps some diagrams might help me understand.

A limit on the size of a square you could fit on the printbed when it is rotated by 45 degrees?

EDIT: I think I see what youā€™re saying now. I need to look at it again tomorrow.

The skew is still present and thus with a 45degree rotation shows up on the lengths of the walls. to compensate for this we need to change the formula and change XY lengths.

Hi @klomar

I mean rotation around the z-axis.
Took me a while to make a drawingā€¦

ā€¦It seems I am not allowed to upload any drawings. Is there a reason for this?
Will post the drawing when this is solved.

Bottom line, by rotating the original print object by 45 degrees a square becomes a rectangle (with perpendicular sides) instead of a rhombus. It should be possible to measure this back in those octagon prints.

Yes, 70% of the max-size which fits on the printbed