Marlin and Endstops I wanted to make my printer a little more user friendly...it

Marlin and Endstops

I wanted to make my printer a little more user friendly…it was working with an optical endstop at some time in the past, but I found the pile of endstops I’d purchased were crap and tended to die after a few weeks. (Swapping a new one in invariably solved the problem.)

Going simple, I purchased a fast-acting microswitch, but in the intervening months, am not sure which version of Marlin had the properly working endstop logic.

I’ve got the endstop plugged into Z-, but cannot seem to get Marlin to respond that it’s working, regardless of whether it’s working correctly. (I can’t seem to get a TRIGGERED state with the switch either open or closed.)

Is there some secret I’m missing? (Like Zmin is actually Zmax…in Marlin)

Make sure you have the right endstops ( max or min ) for what you’re trying to do. I’ve never had a problem with micro switches under marlin.

This is from one of mine.

// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

#ifndef ENDSTOPPULLUPS
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX
// #define ENDSTOPPULLUP_ZMAX
// #define ENDSTOPPULLUP_XMIN
// #define ENDSTOPPULLUP_YMIN
// #define ENDSTOPPULLUP_ZMIN
#endif

#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
#endif

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
// Mike - wired if endstop is wired NC then false - if NO then true (Normally Open / Normally Closed)
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS

// Disable max endstops for compatibility with endstop checking routine
#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
#define DISABLE_MAX_ENDSTOPS
#endif

Yeah, I started getting traction when I discovered the negative pin(?) had backed out of the plug and wasn’t making contact to the board.

I was going to suggest checking the wiring. Triggered or open had nothing to do with the code, only the behavior.

I’ve been messing with the latest version of Marlin recently. Tip: use the RCBugFix branch. It is counterintuitive, but the default branch is NOT more stable.

@SirGeekALot are there major features that would make me want to migrate to another configuration.h? That always scares the crap outta me.

Not that I’m taking advantage of them (yet?) but there is support for filament runout and width sensors, nozzle clean and park, and if you haven’t got a probe on the Z-axis yet (I have an inductive proximity sensor)…get one! I know purists deride them as no substitute for a properly trammed fixed bed, but damn…they just make the whole thing so much more reliable! But really, you just have to comb through it to see if there is anything you want there.

Fyi you should not just copy/paste configuration.h from one version to another, it’s bound to break something. Copy the configuration values instead.

@SirGeekALot the bed on this printer is Bakelite and glass, inductive probes wouldn’t help much (maybe sandwich foil between the two? I kinda sorta wanna buy a printer that has all the new hotness (like end-stops) but my two printers just keep working well enough to not bother (and I’m short a kilo buck)

@Stephanie_A Definitely! I always mark each line I change with a comment containing my name (SirGeekALot), what the value was before I changed it, and if relevant, why I changed it.

@Mike_Miller There is also built-in support for deployable switch style probes that will work on any bed.

To invert end stop or not… Doesn’t that have to do with normally open or normally closed?

Look at https://plus.google.com/u/0/communities/103616587200621103791

The software gives you visual funtion of the endstops. (and alot more)

You also get a Marlin editor that helps you find all the differance from a working Marlin to a new version of Marlin. The biggest benefit is that you get markers on sections where the Firmware is different. As today I only handle the configuration .h. I wil do the rest of the files but ita alot of work to create some kind of “AI” of the marlin firmware and Arduino Syntax