{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/4577","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/4577/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/4577/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/4577/events","html_url":"https://github.com/MarlinFirmware/Marlin/issues/4577","id":170213451,"number":4577,"title":"M851 behaves strange (nozzle crashes into bed)","user":{"login":"christianh17","id":17517578,"avatar_url":"https://avatars.githubusercontent.com/u/17517578?v=3","gravatar_id":"","url":"https://api.github.com/users/christianh17","html_url":"https://github.com/christianh17","followers_url":"https://api.github.com/users/christianh17/followers","following_url":"https://api.github.com/users/christianh17/following{/other_user}","gists_url":"https://api.github.com/users/christianh17/gists{/gist_id}","starred_url":"https://api.github.com/users/christianh17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianh17/subscriptions","organizations_url":"https://api.github.com/users/christianh17/orgs","repos_url":"https://api.github.com/users/christianh17/repos","events_url":"https://api.github.com/users/christianh17/events{/privacy}","received_events_url":"https://api.github.com/users/christianh17/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Support:%20Configuration","name":"Support: Configuration","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":35,"created_at":"2016-08-09T16:37:04Z","updated_at":"2016-08-21T20:12:56Z","closed_at":null,"body":"Hello!\r\n\r\nI use a prusa I3 clone with inductive z-probe. In the past (till RC6) I used a start script like:\r\nG28 ; home all axes\r\nG92 Z1.05\r\nand the distance nozzle - bed was perfect.\r\nYesterday I decided to upgrade to the newest version (there was no issue with RC6 but I wanted to use the new one and perhpas give some feedback) and used the newest bugfix release from August 6th, in the morning.\r\n\r\nNow I have a problem with the distance nozzle-bed.\r\nThe script from above does not work any more, after G29 the nozzle raises (i think it is Z_PROBE_TRAVEL_HEIGHT which is 5 in my configuration) and when I use the G92 command this actual height is used as the starting point.\r\nSo I decided to do it the \"right\" way and want to use the M851 command to adjust the height. So I started with different tests and numbers.\r\n\r\nBut I could not get it to work.\r\nwith M851 Z -2.6 the nozzle crashes in the bed doing the first printing move and with M851 Z -2.5 there are around 2 mm space between nozzle and bed.\r\n\r\nMy settings (I stripped all comments)\r\n```cpp\r\n#define FIX_MOUNTED_PROBE\r\n#define X_PROBE_OFFSET_FROM_EXTRUDER 25  \r\n#define Y_PROBE_OFFSET_FROM_EXTRUDER 20 \r\n#define Z_PROBE_OFFSET_FROM_EXTRUDER 1   \r\n#define XY_PROBE_SPEED 8000\r\n#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z\r\n#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)\r\n#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN\r\n#define Z_PROBE_DEPLOY_HEIGHT 0 \r\n#define Z_PROBE_TRAVEL_HEIGHT 5  \r\n#define Z_PROBE_OFFSET_RANGE_MIN -20\r\n#define Z_PROBE_OFFSET_RANGE_MAX 20\r\n```\r\nI am not sure if it is a bug or if I did a big mistake in configuration.\r\n\r\nShall I send any more information? \r\n\r\nKind regards\r\nChristian"},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/241278962","html_url":"https://github.com/MarlinFirmware/Marlin/issues/4577#issuecomment-241278962","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/4577","id":241278962,"user":{"login":"bgort","id":8062568,"avatar_url":"https://avatars.githubusercontent.com/u/8062568?v=3","gravatar_id":"","url":"https://api.github.com/users/bgort","html_url":"https://github.com/bgort","followers_url":"https://api.github.com/users/bgort/followers","following_url":"https://api.github.com/users/bgort/following{/other_user}","gists_url":"https://api.github.com/users/bgort/gists{/gist_id}","starred_url":"https://api.github.com/users/bgort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgort/subscriptions","organizations_url":"https://api.github.com/users/bgort/orgs","repos_url":"https://api.github.com/users/bgort/repos","events_url":"https://api.github.com/users/bgort/events{/privacy}","received_events_url":"https://api.github.com/users/bgort/received_events","type":"User","site_admin":false},"created_at":"2016-08-21T20:12:56Z","updated_at":"2016-08-21T20:12:56Z","body":"Odd, in my version -- a few commits behind, it looks like -- I have \r\n\r\n```\r\n        float yBase = front_probe_bed_position + yGridSpacing * yCount,\r\n              yProbe = floor(yProbe + (yProbe < 0 ? 0 : 0.5));\r\n```\r\n\r\nWhere yProbe is perhaps incorrectly referenced prior to being initialized, and perhaps incorrectly referenced period?  The xProbe float also has the same problem in what I'm using.\r\n\r\nxProbe and yProbe have been fixed as of 28d1e5a.  I suspect that will take care of the axes flying off into never-never land, and explains the inconsistent behavior (the uninitialized, effectively random, variable).\r\n\r\nI'll do a pull to get to current and then test again.\r\n\r\nAlso, I'll gladly add the code to produce additional debug info, and send the log, if you think that's still relevant?"}}
{"actor":{"display_login":"bgort"}}