{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9839","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9839/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9839/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9839/events","html_url":"https://github.com/MarlinFirmware/Marlin/issues/9839","id":300552210,"number":9839,"title":"[FR] Sensorless Homing for Core XY (XZ and YZ)","user":{"login":"HendrikSP","id":1633861,"avatar_url":"https://avatars0.githubusercontent.com/u/1633861?v=4","gravatar_id":"","url":"https://api.github.com/users/HendrikSP","html_url":"https://github.com/HendrikSP","followers_url":"https://api.github.com/users/HendrikSP/followers","following_url":"https://api.github.com/users/HendrikSP/following{/other_user}","gists_url":"https://api.github.com/users/HendrikSP/gists{/gist_id}","starred_url":"https://api.github.com/users/HendrikSP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HendrikSP/subscriptions","organizations_url":"https://api.github.com/users/HendrikSP/orgs","repos_url":"https://api.github.com/users/HendrikSP/repos","events_url":"https://api.github.com/users/HendrikSP/events{/privacy}","received_events_url":"https://api.github.com/users/HendrikSP/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"thinkyhead","id":698003,"avatar_url":"https://avatars2.githubusercontent.com/u/698003?v=4","gravatar_id":"","url":"https://api.github.com/users/thinkyhead","html_url":"https://github.com/thinkyhead","followers_url":"https://api.github.com/users/thinkyhead/followers","following_url":"https://api.github.com/users/thinkyhead/following{/other_user}","gists_url":"https://api.github.com/users/thinkyhead/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkyhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkyhead/subscriptions","organizations_url":"https://api.github.com/users/thinkyhead/orgs","repos_url":"https://api.github.com/users/thinkyhead/repos","events_url":"https://api.github.com/users/thinkyhead/events{/privacy}","received_events_url":"https://api.github.com/users/thinkyhead/received_events","type":"User","site_admin":false},"assignees":[{"login":"thinkyhead","id":698003,"avatar_url":"https://avatars2.githubusercontent.com/u/698003?v=4","gravatar_id":"","url":"https://api.github.com/users/thinkyhead","html_url":"https://github.com/thinkyhead","followers_url":"https://api.github.com/users/thinkyhead/followers","following_url":"https://api.github.com/users/thinkyhead/following{/other_user}","gists_url":"https://api.github.com/users/thinkyhead/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkyhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkyhead/subscriptions","organizations_url":"https://api.github.com/users/thinkyhead/orgs","repos_url":"https://api.github.com/users/thinkyhead/repos","events_url":"https://api.github.com/users/thinkyhead/events{/privacy}","received_events_url":"https://api.github.com/users/thinkyhead/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-02-27T09:27:37Z","updated_at":"2018-03-01T02:07:20Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nThis is my first post here, so let me thank you all for the effort you put in Marlin!\r\n\r\nI have build a Core XY printer that uses TMC2130 Stepper Drivers. I already got sensorless homing working on X and Y with small modifications to the firmware. My feature request applies for Core XZ and YZ as well, but I will describe it below for XY only to keep this focused.\r\n\r\nThe main problem is that on Core XY printer you need to set both motors (X and Y aka A and B) up for the X or Y homing move.\r\n\r\nI did that on 1.1.8 and noticed that the TMC2130 code has a bit changed in the bugfix 1.1. branch and that sensorless homing for XZ and YZ is now supported as well.\r\n\r\nMy simple code change for 1.1.8 is quite simple:\r\n\r\n```cpp\r\n   #if ENABLED(SENSORLESS_HOMING)\r\n     #if ENABLED(X_IS_TMC2130)\r\n+      #if ENABLED(COREXY) && ENABLED(Y_IS_TMC2130)\r\n+      if (axis == X_AXIS || axis == Y_AXIS) {\r\n+      #else\r\n       if (axis == X_AXIS) {\r\n+      #endif\r\n         currentX = stepperX.getCurrent();\r\n         tmc_sensorless_homing(stepperX);\r\n         stepperX.setCurrent(X_HOMING_CURRENT, R_SENSE, HOLD_MULTIPLIER);\r\n       }\r\n     #endif\r\n```\r\n\r\nSo the Y motor is setup for X homing as well. I did a similar change for the Y homing and X motor and after homing the reconfiguration to \"normal\" operation of both motors in the same fashion.\r\n\r\nHowever when I thought about to adapt it for the bugfix branch and create a PR, I noticed that the code will become ugly quickly since I would have to consider XZ and YZ as well.  So before writing/changing code that will be hard to read and mostly untested (I have neither a XZ nor a YZ printer), I would like to ask for opinions/suggests on that.\r\n"},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/369450130","html_url":"https://github.com/MarlinFirmware/Marlin/issues/9839#issuecomment-369450130","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9839","id":369450130,"user":{"login":"thinkyhead","id":698003,"avatar_url":"https://avatars2.githubusercontent.com/u/698003?v=4","gravatar_id":"","url":"https://api.github.com/users/thinkyhead","html_url":"https://github.com/thinkyhead","followers_url":"https://api.github.com/users/thinkyhead/followers","following_url":"https://api.github.com/users/thinkyhead/following{/other_user}","gists_url":"https://api.github.com/users/thinkyhead/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkyhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkyhead/subscriptions","organizations_url":"https://api.github.com/users/thinkyhead/orgs","repos_url":"https://api.github.com/users/thinkyhead/repos","events_url":"https://api.github.com/users/thinkyhead/events{/privacy}","received_events_url":"https://api.github.com/users/thinkyhead/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T02:07:20Z","updated_at":"2018-03-01T02:07:20Z","author_association":"OWNER","body":"The two PRs above should do the trick. They add a generalized function to enable sensorless homing for an axis (if it has it), taking account of Core / H-bot Kinematics, and makes sure that sensorless homing is configured the same way for both combined axes."}}
{"actor":{"display_login":"thinkyhead"}}