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.
How do I modify the Marlin firmware to have the bed lower as it prints instead of lift like most printers.
3D Printing Stack Exchange is a question and answer site for 3D printing enthusiasts. It only takes a minute to sign up.Sign up to join this community
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
Configuration.h file) to ensure the platform raises when it has to decrease height:
// Invert the stepper direction. Change (or reverse the motor connector) // if an axis goes the wrong way. #define INVERT_Z_DIR true
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):
// Direction of endstops when homing; 1=MAX, -1=MIN #define Z_HOME_DIR -1
Don't forget to set a max Z height that falls within the printer volume, e.g.:
#define Z_MAX_POS 345
If the bed is heavy, you should also prevent the steppers to lose power when not being used, so at least set Z to
// Disables axis stepper immediately when it's not being used. // WARNING: When motors turn off there is a chance of losing position accuracy! #define DISABLE_Z false
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 technically a "lower the bed" 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.
To invert the movement direction of an axis without rewriting the firmware there are two main ways, from mos invasive to easiest:
In Marlin, you can also just flip the direction of the motor via
configuration.h by altering the line from
#define INVERT_Z_DIR true