<p>Note: I have extended my question as some of you mentioned that the question is not clear.</p>

<p>I am using a RAMPS 1.4 board with an Arduino mega 2560. I need to drive a stepper motor as an extruder using either E0 or E1. I am using Repetier-Firmware and can drive the extruder (stepper motor) using the E0 (RAMPS 1.4). 
Now for my application, I need to make sure that the extruder is in home position before it starts to drive for the very first time. I am trying to use a  switch to connect to the end stop and perform this homing operation. I can do this for X, Y, and Z axes. I was wondering how (h/w connections and firmware modification) can I do it for the extruder?</p>

[{'answer_id': 5801, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 2, 'selected': False, 'text': '<p><strong>The edited question</strong> appears to mention that <strong>the actual extruders of the print head need to home / limit themselves</strong>. The answer is that this is not required. When operating direct or Bowden driven extruder setups, you know (or you can measure or find out experimentally) the distance that the filament has to travel from extruder entry to hot end (e.g. to load new filament). If already loaded, because you have printed before, you also know where the filament is (filament could stop after printing, personally I retract the filament en few mm after a print). When a new print starts you usually reverse the retraction at temperature and extrude some extra filament to prime the nozzle to counteract oozed out filament for instance. At that point, the nozzle is primed and the gcode G92 E0 is then used to tell the extruder this is the start at zero length, sort of the home position of the filament. All this is usually done in the start code of your slicer, similar to  disabling bed and hot end temperature or final retract is done in the end code of your slicer.</p>\n\n<p><strong>This answer below addresses the initial question</strong>, this question was not quite clear. It was <strong>phrased as of the head containing the extruders needed to be homed correctly</strong>. The normal end-stops (can be mechanical or optical switches) already ensure that the printer head (containing the extruder or extruders) is homed correctly (if correctly configured in your printer firmware). The home offsets you define in the firmware define that you start at the origin (0,0,0). </p>\n\n<p>Your question does not state what firmware you use, but e.g. in Marlin firmware these settings are found in the <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/Configuration.h" rel="nofollow noreferrer">firmware configuration file</a>.</p>\n\n<p>In this file the following is defined:</p>\n\n<pre><code>// Travel limits (mm) after homing, corresponding to endstop positions.\n#define X_MIN_POS 0\n#define Y_MIN_POS 0\n</code></pre>\n\n<p>These values must be changed according to the offset between your switch and the origin of the heat bed (e.g. Prusa style printers have the origin at the front left).</p>\n\n<p>For my Prusa clone printer I have defined:</p>\n\n<pre><code>// Travel limits (mm) after homing, corresponding to endstop positions.\n#define X_MIN_POS -35\n#define Y_MIN_POS -12\n</code></pre>\n\n<p>What this says is that the homing switch for the X axis is 35 mm left of the origin, etc.</p>\n'}, {'answer_id': 5813, 'author': 'Nick Dancer', 'author_id': 9835, 'author_profile': 'https://3dprinting.stackexchange.com/users/9835', 'pm_score': 1, 'selected': False, 'text': '<p>I think the question has already been answered(if at all possible because the question is still not clear exactly what you mean), but let me try putting this a different way.</p>\n\n<p>You have to ask yourself what is homing and why are you doing it. The purpose of homing your axes is to set their 0 position in space. This then means that any subsequent movements will be relative to these 0 positions and assuming the motors skip no steps should allow accurate positioning of the head inside the build volume throughout the print. In other words their relative position should match their absolute position. As has already been stated the extruder axis does not work like this.</p>\n\n<p>Now I think some of the confusion from your question comes around what you mean by homing the extruder. The extruder position is defined by the previously mentioned X, Y and Z axis. The extruder axis however controls the position of the filament inside the hotend and therefore how much filament is extruded into the build volume. This axis is arbitrarily set to 0 using G92 at the beginning of the print because unlike the spacial axes the absolute position of this axis is not particularly important. Strictly speaking if you were to care about the extruder axis’ absolute position, home would probably be the start of the roll. This however is irrelevant. All that you care about during a print is that the extruder axis remains consistent throughout the print to allow accurate extrusion.</p>\n\n<p>So typically at the beginning of a print you will prime the nozzle to ensure plastic is ready to be extruded as ooze from the previous print may create a delay between moving the extruder axis and plastic actually being extruded. Once the nozzle is primed however the axis position will just be set to 0 and then all future positions of that axis will be relative to where it started on the roll.</p>\n\n<p>Hopefully that helps but if it doesn’t I think we still need more clarification of what you are actually trying to accomplish.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/5800', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/10483/']