<p>I am building a 3D printer from scratch, the bed will only move on Z and the head will stay at the top of the printer and move X and Y.</p>
<p>How do I modify the Marlin firmware to have the bed lower as it prints instead of lift like most printers.</p>

[{'answer_id': 15819, 'author': 'Trish', 'author_id': 8884, 'author_profile': 'https://3dprinting.stackexchange.com/users/8884', 'pm_score': 0, 'selected': False, 'text': '<p>To understand normal commands from a basic printer slicer, all movement commands in g-code are written to be away from the base layer as positive. Note that <em>technically</em> a &quot;lower the bed&quot; printer does violate Orthonormal coordinates unless you either swap X and Y while retaining 0 in the front-left corner or put 0 in the front-right corner, going left for +X (e.g. inverting that motor axis too) and back for -Y.</p>\n<h1>Hardware</h1>\n<p>To <em>invert</em> the movement direction of an axis without rewriting the firmware there are two main ways, from mos invasive to easiest:</p>\n<ul>\n<li>Mount the actuator &quot;upside-down&quot; as that flips the rotational normal vector.</li>\n<li>use a left-hand-threaded rod and nut. This does not flip rotation but how rotation affects the bed.</li>\n<li>alter the stepper cables by &quot;crossing&quot; one of the phases leads. The motor rotates reversed to its commands now.</li>\n</ul>\n<p><a href="https://i.stack.imgur.com/miZU6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/miZU6.jpg" alt="enter image description here" /></a></p>\n<h1>Firmware</h1>\n<p>In Marlin, you can also just flip the direction of the motor via <code>configuration.h</code> by altering the line from <code>false</code> to <code>true</code>:</p>\n<pre><code>#define INVERT_Z_DIR true\n</code></pre>\n'}, {'answer_id': 15820, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 2, 'selected': True, 'text': '<p>You can control in Marlin what the direction of the stepper motor is, e.g. my Hypercube CoreXY printer (which has a similar setup like you described) has the following set (in the Marlin <a href="https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/Configuration.h" rel="nofollow noreferrer"><code>Configuration.h</code></a> file) to ensure the platform raises when it has to decrease height:</p>\n<pre><code>// Invert the stepper direction. Change (or reverse the motor connector) \n// if an axis goes the wrong way.\n#define INVERT_Z_DIR true\n</code></pre>\n<p>Furthermore, it matters where the Z endstop is located, e.g. using a bed probe sensor or a min Z endstop, you need to home towards a decreasing height (in the direction of your probe/endstop):</p>\n<pre><code>// Direction of endstops when homing; 1=MAX, -1=MIN\n#define Z_HOME_DIR -1\n</code></pre>\n<p>Don\'t forget to set a max Z height that falls within the printer volume, e.g.:</p>\n<pre><code>#define Z_MAX_POS 345\n</code></pre>\n<p>If the bed is heavy, you should also prevent the steppers to lose power when not being used, so at least set Z to <code>false</code>:</p>\n<pre><code>// Disables axis stepper immediately when it\'s not being used.\n// WARNING: When motors turn off there is a chance of losing position accuracy!\n#define DISABLE_Z false\n</code></pre>\n'}]
['https://3dprinting.stackexchange.com/questions/15816', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/27229/']