{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11061","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11061/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11061/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11061/events","html_url":"https://github.com/MarlinFirmware/Marlin/pull/11061","id":333756424,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1ODkzNzU1","number":11061,"title":"[2.0.x] Implementation of Backlash Compensation and M425","user":{"login":"marcio-ao","id":29129419,"node_id":"MDQ6VXNlcjI5MTI5NDE5","avatar_url":"https://avatars2.githubusercontent.com/u/29129419?v=4","gravatar_id":"","url":"https://api.github.com/users/marcio-ao","html_url":"https://github.com/marcio-ao","followers_url":"https://api.github.com/users/marcio-ao/followers","following_url":"https://api.github.com/users/marcio-ao/following{/other_user}","gists_url":"https://api.github.com/users/marcio-ao/gists{/gist_id}","starred_url":"https://api.github.com/users/marcio-ao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcio-ao/subscriptions","organizations_url":"https://api.github.com/users/marcio-ao/orgs","repos_url":"https://api.github.com/users/marcio-ao/repos","events_url":"https://api.github.com/users/marcio-ao/events{/privacy}","received_events_url":"https://api.github.com/users/marcio-ao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":43,"created_at":"2018-06-19T16:53:49Z","updated_at":"2018-07-10T23:31:17Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/pulls/11061","html_url":"https://github.com/MarlinFirmware/Marlin/pull/11061","diff_url":"https://github.com/MarlinFirmware/Marlin/pull/11061.diff","patch_url":"https://github.com/MarlinFirmware/Marlin/pull/11061.patch"},"body":"This implements backlash compensation on X, Y and Z. This version implements a more advanced algorithm than proposed in #7579 and is a result of months of internal testing as we led up to the release of our Mini 2.\r\n\r\nThe original implementation proposed in #7579 worked by inserting a new planner block that would cause the motors to rapidly take up any backlash immediately following a motor direction change. Our testing indicated that while this got rid of the backlash, it caused a significant seam on the print due to the momentary pause and vibrations caused by the discontinuity in velocity and acceleration. The new algorithm presented here is less aggressive and has two modes:\r\n\r\n1) The backlash correction steps are added to the planner block in which the direction change takes place. This reduces the appearance of seam by spreading the correction over one segment, but may still show a seam if the segments are very short.\r\n2) When BACKLASH_SMOOTHING is enabled, the backlash correction is applied over one or more segments, reducing the appearance of a seam even for short segments. However, BACKLASH_SMOOTHING requires more storage and CPU overhead, so this is optional.\r\n\r\nThis PR also adds a new \"M425\" command. When enabled, it makes backlash compensation tunable at run-time:\r\n\r\n```\r\n   M425: Enable and tune backlash correction.\r\n   \r\n      F[fraction]     Enable/disable/fade-out backlash correction (0.0 to 1.0)\r\n      S[smoothing_mm] Distance over which backlash correction is spread\r\n      X[distance_mm]  Sets the backlash distance on X (0 to disable)\r\n      Y[distance_mm]                         ... on Y\r\n      Z[distance_mm]                         ... on Z\r\n      X               If a backlash measurent was done on X, copy that value\r\n      Y                                          ... on Y\r\n      Z                                          ... on Z\r\n\r\n  Type M425 without any arguments to show active values.\r\n```\r\nAdditionally, `MEASURE_BACKLASH_WHEN_PROBING` allows the backlash to be measured while probing during G29. If the G29 is followed by \"M425 F1 Z\" it enables backlash compensation with the measured value of backlash on Z.\r\n\r\nThere is the possibility of a similar feature called `MEASURE_BACKLASH_WHEN_HOMING` that could work on X, Y and Z but this PR does not implement it yet.\r\n\r\n-- Marcio"},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/403997832","html_url":"https://github.com/MarlinFirmware/Marlin/pull/11061#issuecomment-403997832","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/11061","id":403997832,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzk5NzgzMg==","user":{"login":"Drachenkaetzchen","id":162974,"node_id":"MDQ6VXNlcjE2Mjk3NA==","avatar_url":"https://avatars1.githubusercontent.com/u/162974?v=4","gravatar_id":"","url":"https://api.github.com/users/Drachenkaetzchen","html_url":"https://github.com/Drachenkaetzchen","followers_url":"https://api.github.com/users/Drachenkaetzchen/followers","following_url":"https://api.github.com/users/Drachenkaetzchen/following{/other_user}","gists_url":"https://api.github.com/users/Drachenkaetzchen/gists{/gist_id}","starred_url":"https://api.github.com/users/Drachenkaetzchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Drachenkaetzchen/subscriptions","organizations_url":"https://api.github.com/users/Drachenkaetzchen/orgs","repos_url":"https://api.github.com/users/Drachenkaetzchen/repos","events_url":"https://api.github.com/users/Drachenkaetzchen/events{/privacy}","received_events_url":"https://api.github.com/users/Drachenkaetzchen/received_events","type":"User","site_admin":false},"created_at":"2018-07-10T23:31:17Z","updated_at":"2018-07-10T23:31:17Z","author_association":"NONE","body":"tl;dr: Measurement works, Mechanical Endstop movement differential is too uncertain to be useful.\r\n\r\nIt finally measures something \\o/\r\n\r\nPrior homing:\r\n\r\n```\r\nRecv: Backlash correction is inactive:\r\nRecv:   Correction Amount/Fade-out:     F0.00     (F1.0 = full, F0.0 = none)\r\nRecv:   Backlash Distance (mm):         X0.00 Y0.00 Z0.00\r\nRecv:   Average measured backlash (mm): (Not yet measured)\r\nRecv: ok\r\n```\r\n\r\nFirst Homing:\r\n\r\n```\r\nSend: M425\r\nRecv: Backlash correction is inactive:\r\nRecv:   Correction Amount/Fade-out:     F0.00     (F1.0 = full, F0.0 = none)\r\nRecv:   Backlash Distance (mm):         X0.00 Y0.00 Z0.00\r\nRecv:   Average measured backlash (mm): X0.70 Y0.74 Z0.00\r\nRecv: ok\r\n```\r\n\r\nSecond homing:\r\n\r\n```\r\nSend: M425\r\nRecv: Backlash correction is inactive:\r\nRecv:   Correction Amount/Fade-out:     F0.00     (F1.0 = full, F0.0 = none)\r\nRecv:   Backlash Distance (mm):         X0.00 Y0.00 Z0.00\r\nRecv:   Average measured backlash (mm): X0.70 Y0.70 Z0.16\r\nRecv: ok\r\n```\r\n\r\nThird homing:\r\n\r\n```\r\nSend: M425\r\nRecv: Backlash correction is inactive:\r\nRecv:   Correction Amount/Fade-out:     F0.00     (F1.0 = full, F0.0 = none)\r\nRecv:   Backlash Distance (mm):         X0.00 Y0.00 Z0.00\r\nRecv:   Average measured backlash (mm): X0.70 Y0.69 Z0.10\r\nRecv: ok\r\n```\r\n\r\nFourth homing:\r\n\r\n```\r\nSend: M425\r\nRecv: Backlash correction is inactive:\r\nRecv:   Correction Amount/Fade-out:     F0.00     (F1.0 = full, F0.0 = none)\r\nRecv:   Backlash Distance (mm):         X0.00 Y0.00 Z0.00\r\nRecv:   Average measured backlash (mm): X0.71 Y0.68 Z0.15\r\nRecv: ok\r\n```\r\n\r\nFrom the values and my measurements, I assume that I have a difference between press/release in the endstops which result in about 0.15-0.2mm measured backlash.\r\n\r\nOn my machine, I use the Makerbot Mechanical Endswitches, which should be Omron D2F-A series. Of course, my endstop switches are a clone, and they use TIAIHUA switches. However, when I judge by the official Omron datasheet, the maximum movement differential is specified with 0.5mm because of the lever, so that's the uncertainity we have (according to the datasheet) and it makes it pretty useless for backlash correction without inventing a procedure on how to calibrate the switch first. On the other hand, once the movement differential is known, I think (or hope) that the repeatability is pretty good - at least it works fine for my Z-Axis.\r\n\r\nAlso, I think the last paragraph should go into the config file somewhere to inform users about the movement differential (Difference between the Operating Position and the Release Position).\r\n\r\nI'd love to test optical and hall effect switches, but unfortunately I'm very short on money. Maybe I'll do some tests with mechanical switches if I have motivation to build a test jig, I'm very curious about the actual values for repeat-ability and movement differential, even across the same endstop types.\r\n\r\n\r\n"}}
{"actor":{"display_login":"Drachenkaetzchen"}}