<p>I had my printer printing fine when using the stock trigger switch as I used it to print the green bracket you see in the picture. </p>

<p><a href="https://i.stack.imgur.com/6kxYw.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/6kxYw.jpg" alt="Photo of probe atached to hotend"></a></p>

<p>My problem now is when I do a print with the sensor, it moves to 0,0 position. However in this position the sensor is hanging off the bed hence there is nothing for it detect so it crashes into the bed.</p>

<p>As far as I can tell the nozzle is homing in the right place.</p>

<p>How do I tell Marlin the new minimum position it needs to be in so it doesn't crash into the bed?</p>

[{'answer_id': 3037, 'author': 'Mikhail Z', 'author_id': 3839, 'author_profile': 'https://3dprinting.stackexchange.com/users/3839', 'pm_score': 1, 'selected': True, 'text': '<p>There are at least 2 options to address the problem that you have:</p>\n\n<ol>\n<li>Adjust end-stops so that in 0,0 position Z-sensor would still hang above the printing table. This would reduce printing surface but allow perfect calibration</li>\n<li>Mount extra metal plate at the table mount where it would not bump into printer parts and remain reachable for the sensor (perhaps with sensor relocation) when positioned at 0,0. This option requires extra space within table movement boundaries but saves printing surface.</li>\n</ol>\n'}, {'answer_id': 6263, 'author': 'OrElse', 'author_id': 10230, 'author_profile': 'https://3dprinting.stackexchange.com/users/10230', 'pm_score': 2, 'selected': False, 'text': "<p>If using <code>marlin firmware</code> center your prints.</p>\n\n<p>In my case...</p>\n\n<pre><code>#define NOZZLE_X          8\n#define NOZZLE_Y          -56\n</code></pre>\n\n<p>Then, set the Z-Probe offset from nozzle.\nIn my case the Z-Probe is 50mm behind the hotend.</p>\n\n<pre><code>#define SENSOR_LEFT        0\n#define SENSOR_RIGHT       0\n#define SENSOR_FRONT       0\n#define SENSOR_BEHIND      50\n</code></pre>\n\n<p>Finally set the bed extra movement. As you see i added the 50mm's at the back of the bed.</p>\n\n<pre><code>#define XTRA_BED_LEFT     0  // Distance nozzle can move towards the left past X = 0\n#define XTRA_BED_RIGHT    0  // Distance nozzle can move towards the right past X = 200\n#define XTRA_BED_FRONT    0  // Distance bed can move towards the front past Y = 200 (Y=280 for large bed)\n#define XTRA_BED_BACK     50  // Distance bed can move towards the back past Y = 0\n</code></pre>\n\n<p>This way once auto leveling, the probe starts with (0,0) and the hotend is 50&nbsp;mm's in front and out of the bed. </p>\n"}, {'answer_id': 6264, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 2, 'selected': False, 'text': '<p><strong>It is not a problem</strong> that the sensor is <em>not above</em> the build plate <strong><em>during printing</em></strong> as long as it is <em>above</em> the build plate <strong><em>during the auto bed levelling sequence</em></strong>.</p>\n\n<p>Homing does not necessarily need to be the <code>(0,0)</code> coordinate. Usually, a printer homes on the endstop switches, from that coordinate an offset is defined in the firmware to move to the origin. This implies that (depending on the position of the sensor), the sensor may be outside the bed area when the nozzle is at the origin <code>(0, 0)</code>). Therefore, similarly, you need to tell the printer the location of the Z sensor with respect to the nozzle position in order for the printer to keep the sensor on the bed when levelling by setting boundaries for the sensor to reach.</p>\n\n<hr>\n\n<p>E.g. for <a href="https://github.com/MarlinFirmware/" rel="nofollow noreferrer">Marlin firmware</a> the offset from homing to the bed origin is defined for an <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/example_configurations/Anet/A8/Configuration.h" rel="nofollow noreferrer">Anet A8</a> by:</p>\n\n<pre><code>#define X_MIN_POS -33\n#define Y_MIN_POS -10\n</code></pre>\n\n<p>The values you should use need to correspond to the actual offset from the homing point to the origin of the bed <code>(0,0)</code>.</p>\n\n<p>When using an auto bed leveling sensor like you are using you should consider this remark:</p>\n\n<blockquote>\n  <p>If using a Probe for Z Homing, enable Z_SAFE_HOMING also!</p>\n</blockquote>\n\n<p>Un-comment the proper line in the configuration file to read:</p>\n\n<pre><code>#define Z_SAFE_HOMING\n</code></pre>\n\n<p>This will make the printer aware of the sensor, and home Z in the middle of the bed (default behavior, but can be changed), so that your sensor is never off the bed when probing the bed for Z homing.</p>\n\n<p>Furthermore, you need to set the offset values of the center of your sensor to the nozzle center:</p>\n\n<pre><code> *   Z Probe to nozzle (X,Y) offset, relative to (0, 0).\n *   X and Y offsets must be integers.\n *\n *   In the following example the X and Y offsets are both positive:\n *   #define X_PROBE_OFFSET_FROM_EXTRUDER 10\n *   #define Y_PROBE_OFFSET_FROM_EXTRUDER 10\n *\n *      +-- BACK ---+\n *      |           |\n *    L |    (+) P  | R &lt;-- probe (20,20)\n *    E |           | I\n *    F | (-) N (+) | G &lt;-- nozzle (10,10)\n *    T |           | H\n *      |    (-)    | T\n *      |           |\n *      O-- FRONT --+\n *    (0,0)\n */\n#define X_PROBE_OFFSET_FROM_EXTRUDER XXX   // X offset: -left  +right  [of the nozzle]\n#define Y_PROBE_OFFSET_FROM_EXTRUDER YYY   // Y offset: -front +behind [the nozzle]\n#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]\n</code></pre>\n\n<p>Where XXX and YYY are your actual values.</p>\n\n<p>And set the boundary of the probing section:</p>\n\n<pre><code>// Set the boundaries for probing (where the probe can reach).\n#define LEFT_PROBE_BED_POSITION 15\n#define RIGHT_PROBE_BED_POSITION 190\n#define FRONT_PROBE_BED_POSITION 15\n#define BACK_PROBE_BED_POSITION 170\n</code></pre>\n\n<p>Note that the values should match your bed size!</p>\n\n<p>And:</p>\n\n<pre><code>// The Z probe minimum outer margin (to validate G29 parameters).\n#define MIN_PROBE_EDGE 10\n</code></pre>\n\n<p>Details on setting the boundaries of the bed to keep the sensor on the bed is described in question "<a href="/q/8153">How to set Z-probe boundary limits in firmware when using automatic bed leveling?</a>".</p>\n'}]
['https://3dprinting.stackexchange.com/questions/3023', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/4408/']