{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5763","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5763/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5763/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5763/events","html_url":"https://github.com/MarlinFirmware/Marlin/pull/5763","id":204203482,"number":5763,"title":"Implements REPROBE and REWIPE, using Nozzle::clean()","user":{"login":"hexane360","id":3290270,"avatar_url":"https://avatars1.githubusercontent.com/u/3290270?v=4","gravatar_id":"","url":"https://api.github.com/users/hexane360","html_url":"https://github.com/hexane360","followers_url":"https://api.github.com/users/hexane360/followers","following_url":"https://api.github.com/users/hexane360/following{/other_user}","gists_url":"https://api.github.com/users/hexane360/gists{/gist_id}","starred_url":"https://api.github.com/users/hexane360/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexane360/subscriptions","organizations_url":"https://api.github.com/users/hexane360/orgs","repos_url":"https://api.github.com/users/hexane360/repos","events_url":"https://api.github.com/users/hexane360/events{/privacy}","received_events_url":"https://api.github.com/users/hexane360/received_events","type":"User","site_admin":false},"labels":[{"id":196933231,"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/PR:%20New%20Feature","name":"PR: New Feature","color":"bfe5bf","default":false},{"id":366365431,"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Status:%20Not%20at%20this%20time","name":"Status: Not at this time","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/milestones/54","html_url":"https://github.com/MarlinFirmware/Marlin/milestone/54","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/milestones/54/labels","id":1835413,"number":54,"title":"1.1.1","description":"Items that we will begin implementing after 1.1.0.","creator":{"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},"open_issues":21,"closed_issues":13,"state":"open","created_at":"2016-06-17T21:45:06Z","updated_at":"2017-08-28T23:14:46Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2017-01-31T04:37:12Z","updated_at":"2017-09-06T16:58:27Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/pulls/5763","html_url":"https://github.com/MarlinFirmware/Marlin/pull/5763","diff_url":"https://github.com/MarlinFirmware/Marlin/pull/5763.diff","patch_url":"https://github.com/MarlinFirmware/Marlin/pull/5763.patch"},"body":"Implements the features described here: https://github.com/MarlinFirmware/Marlin/pull/3553\r\n\r\nLogic works as follows:\r\n-setup_for_endstop_or_probe_move() resets a global variable \"attempt\" to count probe attempts\r\n-do_probe_move now returns bool. If the endstop is triggered before the end of the move, true/success is returned.\r\n-attempt_probe now sits in between run_z_probe and do_probe_move. run_z_probe still controls fast/slow bumps, but attempt_probe now loops do_probe_move until success or failure, rewiping in-between if defined.\r\n\r\nThis PR also fixes a few bugs I found in functions that implement probe_pt, where both probe_pt and the caller function account for XY probe offset, causing the probe to be off in the opposite direction.\r\n\r\nPlease let me know if this fits the criteria discussed in the last PR, or what I need to change."},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/327547947","html_url":"https://github.com/MarlinFirmware/Marlin/pull/5763#issuecomment-327547947","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/5763","id":327547947,"user":{"login":"marcio-ao","id":29129419,"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},"created_at":"2017-09-06T16:58:27Z","updated_at":"2017-09-06T16:58:27Z","author_association":"CONTRIBUTOR","body":"@hexane360: Good work here! I made a similar change to our branch of Marlin, but didn't think of making a pull request for it. One difference is that I treat the number of rewipes as being per probe point, this saves a bit of memory by not having to have a global variable.\r\n\r\nHere is my implementation, very similar to yours, but using a macro:\r\n\r\n```\r\n#define LULZBOT_NUM_REWIPES      2\r\n#define LULZBOT_BED_PROBE_MIN   -3 // Limit on pushing into the bed\r\n\r\n#define LULZBOT_PROBE_Z_WITH_REWIPE(speed) \\\r\n    /* do_probe_move returns true when it fails to hit an endstop, meaning we need to rewipe */ \\\r\n    for(int rewipes = 0; do_probe_move(LULZBOT_BED_PROBE_MIN, speed); rewipes++) { \\\r\n        if(rewipes >= LULZBOT_NUM_REWIPES) {          /* max of tries */ \\\r\n            SERIAL_ERRORLNPGM(\"PROBE FAIL CLEAN NOZZLE\"); /* cura listens for this message specifically */ \\\r\n            LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED);   /* use a more friendly message on the LCD */ \\\r\n            BUZZ(25, 880); BUZZ(50, 0);               /* play tone */ \\\r\n            BUZZ(25, 880); BUZZ(50, 0); \\\r\n            BUZZ(25, 880); BUZZ(50, 0); \\\r\n            do_blocking_move_to_z(100, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); /* raise head */ \\\r\n            stop();                                   /* stop print job */ \\\r\n            LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED);   /* stop changes the message... */ \\\r\n            return NAN;                               /* abort the leveling in progress */ \\\r\n        } \\\r\n        SERIAL_ERRORLNPGM(MSG_REWIPE); \\\r\n        LCD_MESSAGEPGM(MSG_REWIPE); \\\r\n        do_blocking_move_to_z(10, MMM_TO_MMS(speed)); /* raise nozzle */ \\\r\n        Nozzle::clean(0, 2, 0, 0);                    /* wipe nozzle */ \\\r\n    }\r\n```\r\n\r\nAnd in run_z_probe() I replaced the calls to do_probe_move() with the macro, like this:\r\n\r\n```\r\n      #if defined(LULZBOT_PROBE_Z_WITH_REWIPE)\r\n      LULZBOT_PROBE_Z_WITH_REWIPE(Z_PROBE_SPEED_FAST);\r\n      #else\r\n      if (do_probe_move(-10, Z_PROBE_SPEED_FAST)) return NAN;\r\n      #endif\r\n```\r\n"}}
{"actor":{"display_login":"marcio-ao"}}