SET_SKEW crashing Klipper

Basic Information:

Printer Model: Voron 2.4 350x350
MCU / Printerboard: BTT Manta M8P
klippy.log

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

Trying to set [skew_correction] but when I send command:

SET_SKEW XY=141.319,141.524,199.419 XZ=141.444,141.399,199.419 YZ=141.323,141.519,199.325

Klipper crashes and I get this in the slippy.log:

Internal error on command:"SET_SKEW"
Traceback (most recent call last):
  File "/home/pato/klipper/klippy/gcode.py", line 211, in _process_commands
    handler(gcmd)
  File "/home/pato/klipper/klippy/gcode.py", line 137, in <lambda>
    func = lambda params: origfunc(self._get_extended_params(params))
  File "/home/pato/klipper/klippy/extras/skew_correction.py", line 115, in cmd_SET_SKEW
    setattr(self, factor, calc_skew_factor(*lengths))
  File "/home/pato/klipper/klippy/extras/skew_correction.py", line 15, in calc_skew_factor
    side = math.sqrt(2*ac*ac + 2*bd*bd - 4*ad*ad) / 2.
ValueError: math domain error
Transition to shutdown state: Internal error on command:"SET_SKEW"

Any suggestions?.

klippy.log.zip (1.0 MB)

Found something interesting. I went to the Klipper documentation page and there is sample GCODE:

SET_SKEW XY=140.4,142.8,99.8 XZ=141.6,141.4,99.8 YZ=142.4,140.5,99.5

This works!.

Mine is:

SET_SKEW XY=141.319,141.524,199.419 XZ=141.444,141.399,199.419 YZ=141.323,141.519,199.325

I am getting these values from the excel calculation sheet provided by Vector3D, the maker of Calilantern, the model I am using to calculate skew.

I noticed that the third value for every plane on his calculations is in the hundreds and not tens. If I take out the one before each third value, it works. Will try to contact the maker of Calilantern to see if he can help me.

Are you sure you made the correct measurement for the third value?
It appears to be as twice as large as it should be.

1 Like

Not sure al calculations are correct. Measurements are but the excel document provided by Vector3D might have a bug in it. Checking with developer now. I have the suspicion that it might be related to the fact that I printed the Calilantern model at 200% scale to be more accurate on my 350x350 Voron 2.4.

Your values are just wrong causing the module to crash during calculation.
I think the 199.325 should be more like 99.325.

If you read through here and check the picture you should find some hints:
https://www.klipper3d.org/Skew_Correction.html?h=skew#take-your-measurements

Your last value is AD.
If we use this as reference for the legs of an right-angled triangle we can use the Pythagorean theorem:

AC² = 2 * AD²
AC² = 19730.911250
AC = 140.4667

You can solve this for AD as well if you use AC or BD.

Thank you. I heard from the developer of the Calilantern and its spreadsheet and it was, as all said, a calculation error in the spreadsheet once the model was scaled to other than 100% which I did.

2 Likes

Thank you for the feedback!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.