Discussion on axis twist compensation

This thread is surprisingly still open, so I jump in because my message refers to the same module and the topic of the thread is perfect.

In axis_twist_compensation: fix coordinate space mismatch in compensation lookup by ramonsaboya · Pull Request #7246 · Klipper3d/klipper · GitHub a patch has been proposed to solve an issue also reported in Something strange is happening with axis_twist_compensations

To be complete: the bug was reported in Axis_twist_compensation: compensation applied at wrong coordinates due to probe offset - #3 by 3dcoded but due to a dirty klipper and a lack of replies by the person reporting it, the topic was quickly closed.

I went to a different path: I tried to follow the code leading to the bug, with help AI only to direct me to the lines of codes, then understanding the code myself. Disclosure: both Opus 4.8 and Fable 5/max confirmed the bug as well, but I wanted to be sure after the discussion in RFC: Reactor - IO threads by nefelim4ag · Pull Request #7230 · Klipper3d/klipper · GitHub

I think I understood it well and the bug is there. It seems it has been there since the beginning, but it results in small errors (10 microns max, rough estimate), so it went unnoticed.

In my latest post axis_twist_compensation: fix coordinate space mismatch in compensation lookup by ramonsaboya · Pull Request #7246 · Klipper3d/klipper · GitHub I put an extensive explanation of how the bug takes place, to make it easier to follow and understand.

You obviously know the code, can you please give it a look?

@RamonSaboya you wrote the patch

@3dcoded @mdewayne7 you replied to the other thread where the issue was reported

@Murdo you were the first to report it

Judging by my tests, the issue has already been resolved in version v0.13.0-438-g5d24122c; I haven’t delved into the specific code changes, but everything worked “out of the box”—I currently have compensation enabled for both X and Y simultaneously, and it’s all working as intended.

Apologies for the lack of replies in my original post, right after that some life circumstances got in the way of me chasing this.

I’m catching up now, but it’s been a while since I’ve looked into this. I’m installing a new toolhead now with a new gantry and rails, so hopefully I’ll be able to confirm whether it’s still happening in my tests, but I won’t be able to test it on a clean klipper anyways for now.

My experience matches yours. It’s very small errors, but that can be made worst by increasing offsets and bad twists.