Now we have successfully connected our endstop and it is time to setup our firmware.
Fire up Pronterface and connect to your printer.
You can see in the middle of the program, marked by a blue Square, I have added some custom bottoms for actions I use a lot like getting Endstop status, allowing Cold Extrusion and Vis Temperature on Extruder (Vis = show in Danish).
You do not have to create any button, but it is a nice tool. Just click the +, type in some text and the Gcode you want to use. The code for Get Endstop Status is M119
Commands can also just be written in the input boxt in lower right corner, see image, and exectud by pressing enter or send.
Using M119 command
First make sure no endstops are triggered. Move the Axes if neccessary. It makes it much easier to do this if all endstops has the same status. When all is ready you issue the M119 command.
After issueing the command you will most likely see some endstops with the status of OPEN and some with the status TRIGGERED
The ones with the OPEN status are most likely configured correctly, while the other endstops are either defective, activated by your axes or the firmware needs to be corrected.
Now that we have our status we check to see that all the endstop with OPEN status are working correctly. You do that by manually activating them one by one while issue in the M119 command. If the status does not change when activated it is most likely due to bad pin-wiring on Ramps, but it can also be the firmware.
If you have any endstops not behaving you turn off the printer, unplug the USB and Check the pin-connection.Correct as nesccesary.
Also check for continuity again, using a multimeter.
Make a list of the endstops which shows the staus as TRIGGERED when not triggered, or just keep pronterface open to see the output.
Configuring Marlin firmware in Arduino IDE
Open the Configuration.h file/sketch/tab and scroll Down to the @section homing – around line 330 or so.
Make sure you do not have 2 // in front of #define ENDSTOPPULLUPS. If you have, then remove them, upload the firmware to your printer and redo the tests we just did in Pronterface.
Note: remmeber you have to discconnect in Pronterface before uploading firmware or you will get an error in Arduino IDE
Now go Down a few line to “// Mechanical endstop with COM to ground and NC…” and change the value from false to true or the other way, see image, for the endstops outputting TRIGGERED when not triggered.
// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert...
const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert...
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert...
const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert...
const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert..
const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert...
//#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS
Upload the firmware and redo the test in Pronterface.
I changed my Z-min to true from false and it now displays correctly in Pronterface – see image.