I was asked to help get a Cartesian style printer up and running and noticed that the Marlin Firmware was not set correctly for the Mechanical endstop configuration the users had selected. This doesn't really fit into my printer setup but thought I would talk and explain how to setup the firmware for use with a mechanical endstop. Lets first discuss if its better to use NO or NC on the endstop. The answer is NC. This will prevent the issue of crashing the platform into the endstop if something comes undone. The wiring configuration will look like this:
1 = com = wire to signal on your electronics
2 = normally closed (NC) = wire to ground on your electronics
3 = normally open = not required
Note that most Cartesian style printers have the endstops connected to the min pins on the board. It is best to disable the max if not used by going into the pins.h file and setting them to -1.
Once hookup is complete the Marlin firmware will need updating. Open the Configuration.h file and scroll down to the line
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors.
Note that this should NOT be commented out as the pullups need to be supplied by the Ramps board. Now scroll down and little further to the lines:
bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
Make sure that the min endstops are set to false. This is because when the axis hits the switch a digital 1 will be read so no inverting is needed. Don't worry about max as you disabled them above. The last thing to mention is, if you hit home and you notice that the printer is moving the wrong direction check the lines:
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1
Setting these to -1 will have the bed home left, back and extruder carriage down. This would be looking at the front of the printer. I started to add a lot of comments to a standard version of Marlin that I hope will help users get up and printing. Here is a sample
Does anyone find adding detailed comments to Marlin above useful? If so when its finished I will post it for everyone to download.
Nate
Top Comments